mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Change fallback contents to include room display name
This commit is contained in:
parent
44721cb656
commit
d953632884
1 changed files with 6 additions and 1 deletions
|
@ -138,7 +138,12 @@ class NotificationService: UNNotificationServiceExtension {
|
|||
func preprocessPayload(forEventId eventId: String, roomId: String) {
|
||||
guard let session = NotificationService.mxSession else { return }
|
||||
guard let roomDisplayName = session.store.summary?(ofRoom: roomId)?.displayname else { return }
|
||||
bestAttemptContents[eventId]?.title = roomDisplayName
|
||||
let isDirect = session.directUserId(inRoom: roomId) != nil
|
||||
if isDirect {
|
||||
bestAttemptContents[eventId]?.body = NSString.localizedUserNotificationString(forKey: "MESSAGE_FROM_X", arguments: [roomDisplayName as Any])
|
||||
} else {
|
||||
bestAttemptContents[eventId]?.body = NSString.localizedUserNotificationString(forKey: "MESSAGE_IN_X", arguments: [roomDisplayName as Any])
|
||||
}
|
||||
}
|
||||
|
||||
func fetchEvent(withEventId eventId: String, roomId: String) {
|
||||
|
|
Loading…
Reference in a new issue