|
|
@ -278,8 +278,8 @@ public final class SessionCall: CurrentCallProtocol, WebRTCSessionDelegate {
|
|
|
|
let duration: TimeInterval = self.duration
|
|
|
|
let duration: TimeInterval = self.duration
|
|
|
|
let hasStartedConnecting: Bool = self.hasStartedConnecting
|
|
|
|
let hasStartedConnecting: Bool = self.hasStartedConnecting
|
|
|
|
|
|
|
|
|
|
|
|
// Don't know whether there will be an impact if we don't write async
|
|
|
|
Storage.shared.writeAsync(
|
|
|
|
Storage.shared.write { db in
|
|
|
|
updates: { db in
|
|
|
|
guard let interaction: Interaction = try? Interaction.fetchOne(db, id: callInteractionId) else {
|
|
|
|
guard let interaction: Interaction = try? Interaction.fetchOne(db, id: callInteractionId) else {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -327,8 +327,17 @@ public final class SessionCall: CurrentCallProtocol, WebRTCSessionDelegate {
|
|
|
|
includingOlder: false,
|
|
|
|
includingOlder: false,
|
|
|
|
trySendReadReceipt: false
|
|
|
|
trySendReadReceipt: false
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
completion: { _, _ in
|
|
|
|
|
|
|
|
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: - Renderer
|
|
|
|
// MARK: - Renderer
|
|
|
|
|
|
|
|
|
|
|
|