1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-04-22 06:02:03 +02:00

conversationmodel: specify "you" for self-user in title

Change-Id: I01d2cd868c7f1c513290792b5f8bff0f6a110f0e
GitLab: #1250
This commit is contained in:
Sébastien Blin 2023-07-07 13:29:28 -04:00
parent a7bd860e2b
commit 03b3530d3d

View file

@ -1157,6 +1157,8 @@ ConversationModel::title(const QString& conversationId) const
if (peer.isEmpty()) if (peer.isEmpty())
return {}; return {};
// In this case, we can just display contact name // In this case, we can just display contact name
if (peer.at(0) == owner.profileInfo.uri)
return QObject::tr("%1 (you)").arg(owner.accountModel->bestNameForAccount(owner.id));
return owner.contactModel->bestNameForContact(peer.at(0)); return owner.contactModel->bestNameForContact(peer.at(0));
} }
if (conversation.infos["title"] != "") { if (conversation.infos["title"] != "") {
@ -1169,7 +1171,7 @@ ConversationModel::title(const QString& conversationId) const
for (const auto& member : conversation.participants) { for (const auto& member : conversation.participants) {
QString name; QString name;
if (member.uri == owner.profileInfo.uri) { if (member.uri == owner.profileInfo.uri) {
name = owner.accountModel->bestNameForAccount(owner.id); name = QObject::tr("%1 (you)").arg(owner.accountModel->bestNameForAccount(owner.id));
} else { } else {
name = owner.contactModel->bestNameForContact(member.uri); name = owner.contactModel->bestNameForContact(member.uri);
} }