diff --git a/src/contactmodel.cpp b/src/contactmodel.cpp index 79528b45c0af616ec2ffb29241ad2c4e4221a153..83653f85e7542fd5833ea7c55bfcc4f9eba61963 100644 --- a/src/contactmodel.cpp +++ b/src/contactmodel.cpp @@ -689,6 +689,7 @@ ContactModelPimpl::slotRegisteredNameFound(const std::string& accountId, } { std::lock_guard<std::mutex> lk(contactsMtx_); + temporaryContact.registeredName = registeredName; temporaryContact.profileInfo.alias = "Not found"; } emit linked.modelUpdated(uri); diff --git a/src/conversationmodel.cpp b/src/conversationmodel.cpp index cb506ba282c9b52a945fa651b7a656f864f09c74..d6296c6f56a519b9334c0b1b6bd880e5051216d4 100644 --- a/src/conversationmodel.cpp +++ b/src/conversationmodel.cpp @@ -301,13 +301,16 @@ ConversationModel::allFilteredConversations() const || contactInfo.registeredName == pimpl_->filter; } + auto regexFilter = std::regex(pimpl_->filter, std::regex_constants::icase); /* Check type */ if (pimpl_->typeFilter != profile::Type::PENDING) { // Remove pending contacts and get the temporary item if filter is not empty if (contactInfo.profileInfo.type == profile::Type::PENDING) return false; if (contactInfo.profileInfo.type == profile::Type::TEMPORARY) - return not contactInfo.profileInfo.alias.empty() || not contactInfo.profileInfo.uri.empty(); + return (!contactInfo.profileInfo.uri.empty() + && std::regex_search(contactInfo.profileInfo.uri, regexFilter)) + || std::regex_search(contactInfo.registeredName, regexFilter); } else { // We only want pending requests matching with the filter if (contactInfo.profileInfo.type != profile::Type::PENDING) @@ -316,7 +319,6 @@ ConversationModel::allFilteredConversations() const // Otherwise perform usual regex search try { - auto regexFilter = std::regex(pimpl_->filter, std::regex_constants::icase); bool result = std::regex_search(contactInfo.profileInfo.uri, regexFilter) | std::regex_search(contactInfo.profileInfo.alias, regexFilter) | std::regex_search(contactInfo.registeredName, regexFilter);