mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Do not store event below iOS 13, add some original fields to the stored event
This commit is contained in:
parent
cdaa89b34f
commit
9db7712a23
1 changed files with 12 additions and 6 deletions
|
@ -586,16 +586,22 @@ class NotificationService: UNNotificationServiceExtension {
|
|||
return
|
||||
}
|
||||
|
||||
if event.isEncrypted {
|
||||
if #available(iOS 13.0, *) {
|
||||
guard event.clear != nil else {
|
||||
if #available(iOS 13.0, *) {
|
||||
if event.isEncrypted {
|
||||
guard let clearEvent = event.clear else {
|
||||
NSLog("[NotificationService] sendVoipPush: Do not send a VoIP push for undecrypted event, it'll cause a crash.")
|
||||
return
|
||||
}
|
||||
|
||||
// Add some original data on the clear event
|
||||
clearEvent.eventId = event.eventId
|
||||
clearEvent.originServerTs = event.originServerTs
|
||||
clearEvent.sender = event.sender
|
||||
clearEvent.roomId = event.roomId
|
||||
pushNotificationStore.storeCallInvite(clearEvent)
|
||||
} else {
|
||||
pushNotificationStore.storeCallInvite(event)
|
||||
}
|
||||
pushNotificationStore.storeCallInvite(event.clear)
|
||||
} else {
|
||||
pushNotificationStore.storeCallInvite(event)
|
||||
}
|
||||
|
||||
ongoingVoIPPushRequests[event.eventId] = true
|
||||
|
|
Loading…
Reference in a new issue