Merge branch 'develop' of https://github.com/vector-im/element-ios into langleyd/5292_refresh_tokens

This commit is contained in:
David Langley
2022-01-06 22:43:20 +00:00
312 changed files with 8682 additions and 2325 deletions

View File

@@ -404,8 +404,8 @@ class NotificationService: UNNotificationServiceExtension {
}
}
let msgType = event.content["msgtype"] as? String
let messageContent = event.content["body"] as? String
let msgType = event.content[kMXMessageTypeKey] as? String
let messageContent = event.content[kMXMessageBodyKey] as? String
let isReply = event.isReply()
if isReply {
@@ -420,6 +420,11 @@ class NotificationService: UNNotificationServiceExtension {
break
}
if event.location != nil {
notificationBody = NSString.localizedUserNotificationString(forKey: "LOCATION_FROM_USER", arguments: [eventSenderName])
break
}
switch msgType {
case kMXMessageTypeEmote:
notificationBody = NSString.localizedUserNotificationString(forKey: "ACTION_FROM_USER", arguments: [eventSenderName, messageContent as Any])
@@ -519,6 +524,9 @@ class NotificationService: UNNotificationServiceExtension {
additionalUserInfo = [Constants.userInfoKeyPresentNotificationOnForeground: true]
}
}
case .pollStart:
notificationTitle = self.messageTitle(for: eventSenderName, in: roomDisplayName)
notificationBody = MXEventContentPollStart(fromJSON: event.content)?.question
default:
break
}