From 392c423bc1413fd1da3d15d1dea45aad9826d513 Mon Sep 17 00:00:00 2001 From: Andreas Traczyk Date: Tue, 22 Jun 2021 14:25:07 -0400 Subject: [PATCH] conversations: fix filter setting when a conversation is selected Set the account and request filters separately. Change-Id: Ib7d93caa4058e086d3cbcf39ac3fb9a30097aba1 --- src/conversationsadapter.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/conversationsadapter.cpp b/src/conversationsadapter.cpp index bddfb449..de175bec 100644 --- a/src/conversationsadapter.cpp +++ b/src/conversationsadapter.cpp @@ -73,16 +73,11 @@ ConversationsAdapter::ConversationsAdapter(SystemTray* systemTray, accInfo.conversationModel->selectConversation(convInfo.uid); accInfo.conversationModel->clearUnreadInteractions(convInfo.uid); - try { - // Set contact filter (for conversation tab selection) - // WARNING: not swarm ready - auto& contact = accInfo.contactModel->getContact(convInfo.participants.front()); - if (contact.profileInfo.type != profile::Type::INVALID - && contact.profileInfo.type != profile::Type::TEMPORARY) - set_profileTypeFilter(contact.profileInfo.type); - } catch (const std::out_of_range& e) { - qWarning() << e.what(); - } + // set the account type filter corresponding to the conversation's account type + set_profileTypeFilter(accInfo.profileInfo.type); + + // this may be a request, so adjust that filter also + set_filterRequests(convInfo.isRequest); // reposition index in case of programmatic selection // currently, this may only occur for the conversation list