Skip to content
Snippets Groups Projects
Commit 910db9b7 authored by Hugo Lefeuvre's avatar Hugo Lefeuvre Committed by Sébastien Blin
Browse files

conversationmodel: filter out invalid items


Change-Id: I066675fe6d02e6b3f86d4c9105f2982255323a4d
Gitlab: #386
Reviewed-by: default avatarSebastien Blin <sebastien.blin@savoirfairelinux.com>
parent a071950d
No related branches found
No related tags found
No related merge requests found
...@@ -318,12 +318,15 @@ ConversationModel::allFilteredConversations() const ...@@ -318,12 +318,15 @@ ConversationModel::allFilteredConversations() const
/* Check type */ /* Check type */
if (pimpl_->typeFilter != profile::Type::PENDING) { if (pimpl_->typeFilter != profile::Type::PENDING) {
// Remove pending contacts and get the temporary item if filter is not empty // Remove pending contacts and get the temporary item if filter is not empty
if (contactInfo.profileInfo.type == profile::Type::PENDING) switch (contactInfo.profileInfo.type) {
case profile::Type::INVALID:
case profile::Type::PENDING:
return false; return false;
if (contactInfo.profileInfo.type == profile::Type::TEMPORARY) case profile::Type::TEMPORARY:
return (!contactInfo.profileInfo.uri.empty() return (!contactInfo.profileInfo.uri.empty()
&& std::regex_search(contactInfo.profileInfo.uri, regexFilter)) && std::regex_search(contactInfo.profileInfo.uri, regexFilter))
|| std::regex_search(contactInfo.registeredName, regexFilter); || std::regex_search(contactInfo.registeredName, regexFilter);
}
} else { } else {
// We only want pending requests matching with the filter // We only want pending requests matching with the filter
if (contactInfo.profileInfo.type != profile::Type::PENDING) if (contactInfo.profileInfo.type != profile::Type::PENDING)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment