try to fix a call issue when iOS is on lock screen

This commit is contained in:
Ryan Zhao 2022-04-11 10:36:21 +10:00
parent d5d1c822a8
commit b23038087f
2 changed files with 3 additions and 2 deletions

View File

@ -250,9 +250,8 @@ public enum PushRegistrationError: Error {
call.callMessageID = infoMessage.uniqueId
}
let appDelegate = UIApplication.shared.delegate as! AppDelegate
// NOTE: Just start 1-1 poller so that it won't wait for polling group messages
appDelegate.startPollerIfNeeded()
appDelegate.startClosedGroupPoller()
appDelegate.startOpenGroupPollersIfNeeded()
call.reportIncomingCallIfNeeded { error in
if let error = error {
SNLog("[Calls] Failed to report incoming call to CallKit due to error: \(error)")

View File

@ -174,6 +174,8 @@ public enum MessageReceiver {
// This method was invoked and the received message timestamps table was updated
// Processing wasn't finished
// The user doesn't see the new closed group
} else if let message = message as? CallMessage, case .offer = message.kind{
// Allow duplicates for all call offer messages
} else {
guard !Set(storage.getReceivedMessageTimestamps(using: transaction)).contains(envelope.timestamp) || isRetry else { throw Error.duplicateMessage }
storage.addReceivedMessageTimestamp(envelope.timestamp, using: transaction)