|
|
|
@ -140,6 +140,7 @@ public final class SessionCallManager: NSObject, CallManagerProtocol {
|
|
|
|
|
|
|
|
|
|
guard let call = currentCall else {
|
|
|
|
|
handleCallEnded()
|
|
|
|
|
Self.suspendDatabaseIfCallEndedInBackground()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -177,6 +178,15 @@ public final class SessionCallManager: NSObject, CallManagerProtocol {
|
|
|
|
|
callUpdate.supportsDTMF = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static func suspendDatabaseIfCallEndedInBackground() {
|
|
|
|
|
if CurrentAppContext().isInBackground() {
|
|
|
|
|
// Stop all jobs except for message sending and when completed suspend the database
|
|
|
|
|
JobRunner.stopAndClearPendingJobs(exceptForVariant: .messageSend) {
|
|
|
|
|
NotificationCenter.default.post(name: Database.suspendNotification, object: self)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MARK: - UI
|
|
|
|
|
|
|
|
|
|
public func showCallUIForCall(caller: String, uuid: String, mode: CallMode, interactionId: Int64?) {
|
|
|
|
|