@@ -110,13 +110,13 @@ struct NotificationContentBuilder {
110110 notificationContent. body = body
111111
112112 let name = notificationItem. senderDisplayName ?? notificationItem. roomDisplayName
113- await addSenderIcon ( notificationContent: & notificationContent,
114- senderID: notificationItem. senderID,
115- senderAvatarDisplayName: name,
116- senderDisplayName: name,
117- icon: icon ( for: notificationItem) ,
118- forcePlaceholder: userSession. inviteAvatarsVisibility == . off,
119- mediaProvider: mediaProvider)
113+ await addCommunicationContext ( notificationContent: & notificationContent,
114+ senderID: notificationItem. senderID,
115+ senderAvatarDisplayName: name,
116+ senderDisplayName: name,
117+ icon: icon ( for: notificationItem) ,
118+ forcePlaceholder: userSession. inviteAvatarsVisibility == . off,
119+ mediaProvider: mediaProvider)
120120 }
121121
122122 private func processMessageLike( notificationContent: inout UNMutableNotificationContent ,
@@ -136,12 +136,12 @@ struct NotificationContentBuilder {
136136
137137 let senderDisplayName = notificationItem. hasMention ? L10n . notificationSenderMentionReply ( senderAvatarDisplayName) : senderAvatarDisplayName
138138
139- await addSenderIcon ( notificationContent: & notificationContent,
140- senderID: notificationItem. senderID,
141- senderAvatarDisplayName: senderAvatarDisplayName,
142- senderDisplayName: senderDisplayName,
143- icon: icon ( for: notificationItem) ,
144- mediaProvider: mediaProvider)
139+ await addCommunicationContext ( notificationContent: & notificationContent,
140+ senderID: notificationItem. senderID,
141+ senderAvatarDisplayName: senderAvatarDisplayName,
142+ senderDisplayName: senderDisplayName,
143+ icon: icon ( for: notificationItem) ,
144+ mediaProvider: mediaProvider)
145145 }
146146
147147 private func icon( for notificationItem: NotificationItemProxyProtocol ) -> NotificationIcon {
@@ -231,13 +231,13 @@ struct NotificationContentBuilder {
231231 }
232232 }
233233
234- private func addSenderIcon ( notificationContent: inout UNMutableNotificationContent ,
235- senderID: String ,
236- senderAvatarDisplayName: String ,
237- senderDisplayName: String ,
238- icon: NotificationIcon ,
239- forcePlaceholder: Bool = false ,
240- mediaProvider: MediaProviderProtocol ) async {
234+ private func addCommunicationContext ( notificationContent: inout UNMutableNotificationContent ,
235+ senderID: String ,
236+ senderAvatarDisplayName: String ,
237+ senderDisplayName: String ,
238+ icon: NotificationIcon ,
239+ forcePlaceholder: Bool = false ,
240+ mediaProvider: MediaProviderProtocol ) async {
241241 var fetchedImage : INImage ?
242242 let image : INImage
243243 if !forcePlaceholder,
@@ -297,7 +297,9 @@ struct NotificationContentBuilder {
297297 interaction. direction = . incoming
298298
299299 // Donate the interaction before updating notification content.
300- try ? await interaction. donate ( )
300+ if !ProcessInfo. isRunningTests {
301+ try ? await interaction. donate ( )
302+ }
301303
302304 // Update notification content before displaying the
303305 // communication notification.
0 commit comments