From 03b3530d3dfc83e462f137a8fef79a2eeb660a0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Fri, 7 Jul 2023 13:29:28 -0400
Subject: [PATCH] conversationmodel: specify "you" for self-user in title

Change-Id: I01d2cd868c7f1c513290792b5f8bff0f6a110f0e
GitLab: #1250
---
 src/libclient/conversationmodel.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libclient/conversationmodel.cpp b/src/libclient/conversationmodel.cpp
index 8cb91c711..e539397d2 100644
--- a/src/libclient/conversationmodel.cpp
+++ b/src/libclient/conversationmodel.cpp
@@ -1157,6 +1157,8 @@ ConversationModel::title(const QString& conversationId) const
         if (peer.isEmpty())
             return {};
         // 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));
     }
     if (conversation.infos["title"] != "") {
@@ -1169,7 +1171,7 @@ ConversationModel::title(const QString& conversationId) const
     for (const auto& member : conversation.participants) {
         QString name;
         if (member.uri == owner.profileInfo.uri) {
-            name = owner.accountModel->bestNameForAccount(owner.id);
+            name = QObject::tr("%1 (you)").arg(owner.accountModel->bestNameForAccount(owner.id));
         } else {
             name = owner.contactModel->bestNameForContact(member.uri);
         }
-- 
GitLab