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.
This commit is contained in:
Pascal Precht 2021-02-23 11:45:11 +01:00 committed by Iuri Matias
parent 84806ee96c
commit bd9fa37ce3
1 changed files with 2 additions and 2 deletions

View File

@ -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 <span style='color: %1'>%2</span> 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 <span style='color: %1'>%2</span>"
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 "";
}
}