1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-31 20:23:30 +02:00

conversations: fix filter setting when a conversation is selected

Set the account and request filters separately.

Change-Id: Ib7d93caa4058e086d3cbcf39ac3fb9a30097aba1
This commit is contained in:
Andreas Traczyk 2021-06-22 14:25:07 -04:00
parent 416be0833c
commit 392c423bc1

View file

@ -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