potentially fix a issue that the calls won't get connected

This commit is contained in:
ryanzhao 2022-04-20 14:22:36 +10:00
parent a92d626c1e
commit abafffbfe2
1 changed files with 3 additions and 2 deletions

View File

@ -174,8 +174,9 @@ 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 if let message = message as? CallMessage, message.kind?.description != "preOffer" {
// Allow duplicates for all call messages except preOffer which may generate
// a new incoming call
} else {
guard !Set(storage.getReceivedMessageTimestamps(using: transaction)).contains(envelope.timestamp) || isRetry else { throw Error.duplicateMessage }
storage.addReceivedMessageTimestamp(envelope.timestamp, using: transaction)