mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2026-01-05 12:21:37 +08:00
presence: fix presence status for swarm with multiple members
Change-Id: Ic2e86b932c4805016689ffc41e4cede26b715954
This commit is contained in:
@@ -171,17 +171,19 @@ ConversationListModelBase::dataForItem(item_t item, int role) const
|
||||
return ret;
|
||||
}
|
||||
case Role::Presence: {
|
||||
// The conversation can show a green dot if at least one peer is present
|
||||
// A conversation presence is the max of the members presence
|
||||
auto maxPresence = 0;
|
||||
Q_FOREACH (const auto& peerUri, model_->peersForConversation(item.uid))
|
||||
try {
|
||||
auto& accInfo = lrcInstance_->getAccountInfo(accountId_);
|
||||
if (peerUri == accInfo.profileInfo.uri)
|
||||
return 2; // Self account
|
||||
auto contact = accInfo.contactModel->getContact(peerUri);
|
||||
return contact.presence;
|
||||
if (contact.presence > maxPresence)
|
||||
maxPresence = contact.presence;
|
||||
} catch (const std::exception&) {
|
||||
}
|
||||
return false;
|
||||
return maxPresence;
|
||||
};
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user