mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
MSC4075 Use expirationTS to define the call ringing window (#4652)
* Listen to call decline to stop ringing when declined from other device * MSC4075 Use expirationTS to define the call ringing window * Implement ElementCallService tests. * Update acknowledgements.
This commit is contained in:
@@ -125,10 +125,11 @@ class NotificationHandler {
|
||||
}
|
||||
|
||||
return .processedShouldDiscard
|
||||
case .rtcNotification(let notificationType, _):
|
||||
case .rtcNotification(let notificationType, let expirationTimestamp):
|
||||
return await handleCallNotification(notificationType: notificationType,
|
||||
rtcNotifyEventID: event.eventId(),
|
||||
timestamp: event.timestamp(),
|
||||
expirationTimestamp: expirationTimestamp,
|
||||
roomID: itemProxy.roomID,
|
||||
roomDisplayName: itemProxy.roomDisplayName)
|
||||
case .callAnswer,
|
||||
@@ -157,6 +158,7 @@ class NotificationHandler {
|
||||
private func handleCallNotification(notificationType: RtcNotificationType,
|
||||
rtcNotifyEventID: String,
|
||||
timestamp: Timestamp,
|
||||
expirationTimestamp: Timestamp,
|
||||
roomID: String,
|
||||
roomDisplayName: String) async -> NotificationProcessingResult {
|
||||
// Handle incoming VoIP calls, show the native OS call screen
|
||||
@@ -208,9 +210,11 @@ class NotificationHandler {
|
||||
}
|
||||
}
|
||||
|
||||
let expirationDate = Date(timeIntervalSince1970: TimeInterval(expirationTimestamp / 1000))
|
||||
let payload = [ElementCallServiceNotificationKey.roomID.rawValue: roomID,
|
||||
ElementCallServiceNotificationKey.roomDisplayName.rawValue: roomDisplayName,
|
||||
ElementCallServiceNotificationKey.rtcNotifyEventID.rawValue: rtcNotifyEventID]
|
||||
ElementCallServiceNotificationKey.expirationDate.rawValue: expirationDate,
|
||||
ElementCallServiceNotificationKey.rtcNotifyEventID.rawValue: rtcNotifyEventID] as [String: Any]
|
||||
|
||||
do {
|
||||
try await CXProvider.reportNewIncomingVoIPPushPayload(payload)
|
||||
|
||||
Reference in New Issue
Block a user