From e2eddc525ceffe44d72728976ffd791e63402eec Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Tue, 9 Apr 2024 18:21:47 +0100 Subject: [PATCH] fix: proper content for bridged messages in OS notifications (#14377) --- src/app/modules/main/chat_section/module.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/modules/main/chat_section/module.nim b/src/app/modules/main/chat_section/module.nim index 23222e36e3..0033938e8c 100644 --- a/src/app/modules/main/chat_section/module.nim +++ b/src/app/modules/main/chat_section/module.nim @@ -1183,13 +1183,17 @@ method onNewMessagesReceived*(self: Module, sectionIdMsgBelongsTo: string, chatI elif(message.isGlobalMention()): notificationType = notification_details.NotificationType.NewMessageWithGlobalMention - let contactDetails = self.controller.getContactDetails(message.`from`) + var senderDisplayName = self.controller.getContactDetails(message.`from`).defaultDisplayName let communityChats = self.controller.getMyCommunity().chats let renderedMessageText = self.controller.getRenderedText(message.parsedText, communityChats) var plainText = singletonInstance.utils.plainText(renderedMessageText) if message.contentType == ContentType.Sticker or (message.contentType == ContentType.Image and len(plainText) == 0): plainText = "🖼️" - var notificationTitle = contactDetails.defaultDisplayName + if message.contentType == ContentType.BridgeMessage: + senderDisplayName = message.bridgeMessage.userName + plainText = message.bridgeMessage.content + + var notificationTitle = senderDisplayName case chatDetails.chatType: of ChatType.PrivateGroupChat: