From bd9fa37ce3d473b557010c101bd2b1b6ed7cd3cf Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 23 Feb 2021 11:45:11 +0100 Subject: [PATCH] fix(Chat): ensure correct contact username is shown In some cases inside of 1-on-1 chats, the fake messages added to the beginning of the message list, wouldn't determine the correct username of the contact in question. This commit explicitly calls `chatsModel.userNameOrAlias()` instead of relying on `activeChannel.name` which tries to do the same. --- .../Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml index 42797a67d6..1fea67c788 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml @@ -59,7 +59,7 @@ Column { text: { switch(chatsModel.activeChannel.chatType) { case Constants.chatTypePublic: return "#" + chatsModel.activeChannel.name; - case Constants.chatTypeOneToOne: return Utils.removeStatusEns(chatsModel.activeChannel.name) + case Constants.chatTypeOneToOne: return Utils.removeStatusEns(chatsModel.userNameOrAlias(chatsModel.activeChannel.id)) default: return chatsModel.activeChannel.name } } @@ -84,7 +84,7 @@ Column { //% "Welcome to the beginning of the %2 group!" case Constants.chatTypePrivateGroupChat: return qsTrId("welcome-to-the-beginning-of-the--span-style--color---1---2--span--group-").arg(Style.current.textColor).arg(chatsModel.activeChannel.name); //% "Any messages you send here are encrypted and can only be read by you and %2" - case Constants.chatTypeOneToOne: return qsTrId("any-messages-you-send-here-are-encrypted-and-can-only-be-read-by-you-and--span-style--color---1---2--span-").arg(Style.current.textColor).arg(Utils.removeStatusEns(chatsModel.activeChannel.name)) + case Constants.chatTypeOneToOne: return qsTrId("any-messages-you-send-here-are-encrypted-and-can-only-be-read-by-you-and--span-style--color---1---2--span-").arg(Style.current.textColor).arg(channelName.text) default: return ""; } }