fix(@dekstop/chat): mentioning oneself display the full key instead of username

Fixes #4897
This commit is contained in:
Sale Djenic 2022-03-08 10:19:16 +01:00 committed by saledjenic
parent 895a0b5d47
commit 4ff700681f
2 changed files with 6 additions and 1 deletions

View File

@ -51,7 +51,7 @@ method isLoaded*(self: Module): bool =
method viewDidLoad*(self: Module) =
# add me as the first user to the list
let (admin, joined) = self.controller.getChatMemberInfo(singletonInstance.userProfile.getPubKey())
let loggedInUserDisplayName = singletonInstance.userProfile.getName() & "(You)"
let loggedInUserDisplayName = singletonInstance.userProfile.getName() & " (You)"
self.view.model().addItem(initItem(
singletonInstance.userProfile.getPubKey(),
loggedInUserDisplayName,

View File

@ -142,6 +142,11 @@ Rectangle {
property var mentionsPos: []
function insertMention(aliasName, lastAtPosition, lastCursorPosition) {
let startInd = aliasName.indexOf("(");
if (startInd > 0){
aliasName = aliasName.substring(0, startInd-1)
}
const hasEmoji = StatusQUtils.Emoji.hasEmoji(messageInputField.text)
const spanPlusAlias = `${Constants.mentionSpanTag}@${aliasName}</a></span> `;