Show mention notification/AC once for a message with multiple images (#3485)

This commit is contained in:
Ibrahem Khalil 2023-06-10 11:57:40 +03:00 committed by GitHub
parent b6d4e75cf1
commit 47711c4f15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -1 +1 @@
0.157.1
0.157.2

View File

@ -3141,10 +3141,20 @@ func (r *ReceivedMessageState) addNewActivityCenterNotification(publicKey ecdsa.
return fmt.Errorf("chat ID '%s' not present", message.LocalChatID)
}
// Use albumId as notificationId to prevent multiple notifications
// for same message with multiple images
var idToUse string
if message.GetImage() != nil {
idToUse = message.GetImage().GetAlbumId()
} else {
idToUse = message.ID
}
isNotification, notificationType := showMentionOrReplyActivityCenterNotification(publicKey, message, chat, responseTo)
if isNotification {
notification := &ActivityCenterNotification{
ID: types.FromHex(message.ID),
ID: types.FromHex(idToUse),
Name: chat.Name,
Message: message,
ReplyMessage: responseTo,