Fix for the sender icon not being rendered in notifications sometimes (#862)

* fix for the sender icon not being rendered sometimes in notifications

* removing a line

* removing the environment every time we run a zsh command

* removed unused parameters that we already have stored in the notification

* changelog
This commit is contained in:
Mauro
2023-05-08 17:05:55 +02:00
committed by GitHub
parent 8cfb415410
commit 542cefd703
4 changed files with 39 additions and 23 deletions
@@ -232,22 +232,17 @@ extension NotificationItemProxyProtocol {
notification.sound = isNoisy ? UNNotificationSound(named: UNNotificationSoundName(rawValue: "message.caf")) : nil
let senderName = senderDisplayName ?? roomDisplayName
var groupName: String?
var mediaSource: MediaSourceProxy?
let iconType: NotificationIconType
if !isDirect {
groupName = senderName != roomDisplayName ? roomDisplayName : nil
mediaSource = roomAvatarMediaSource
iconType = .group(mediaSource: roomAvatarMediaSource, groupName: roomDisplayName)
} else {
mediaSource = senderAvatarMediaSource
iconType = .sender(mediaSource: senderAvatarMediaSource)
}
notification = try await notification.addSenderIcon(using: mediaProvider,
senderId: event.senderID,
receiverId: receiverID,
senderID: event.senderID,
senderName: senderName,
groupName: groupName,
mediaSource: mediaSource,
roomId: roomID)
iconType: iconType)
return notification
}