mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-30 15:46:30 +00:00
Don't display duplicate push messages.
This commit is contained in:
@@ -40,6 +40,7 @@ import org.thoughtcrime.securesms.service.PushReceiver;
|
||||
import org.thoughtcrime.securesms.service.SendReceiveService;
|
||||
import org.thoughtcrime.securesms.sms.SmsTransportDetails;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.textsecure.crypto.DuplicateMessageException;
|
||||
import org.whispersystems.textsecure.crypto.InvalidKeyException;
|
||||
import org.whispersystems.textsecure.crypto.InvalidMessageException;
|
||||
import org.whispersystems.textsecure.crypto.InvalidVersionException;
|
||||
@@ -213,6 +214,9 @@ public class DecryptingQueue {
|
||||
} catch (RecipientFormattingException e) {
|
||||
Log.w("DecryptionQueue", e);
|
||||
sendResult(PushReceiver.RESULT_DECRYPT_FAILED);
|
||||
} catch (DuplicateMessageException e) {
|
||||
Log.w("DecryptingQueue", e);
|
||||
sendResult(PushReceiver.RESULT_DECRYPT_DUPLICATE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,6 +316,9 @@ public class DecryptingQueue {
|
||||
} catch (InvalidMessageException ime) {
|
||||
Log.w("DecryptingQueue", ime);
|
||||
database.markAsDecryptFailed(messageId, threadId);
|
||||
} catch (DuplicateMessageException dme) {
|
||||
Log.w("DecryptingQueue", dme);
|
||||
database.markAsDecryptDuplicate(messageId, threadId);
|
||||
} catch (MmsException mme) {
|
||||
Log.w("DecryptingQueue", mme);
|
||||
database.markAsDecryptFailed(messageId, threadId);
|
||||
@@ -391,6 +398,10 @@ public class DecryptingQueue {
|
||||
Log.w("DecryptionQueue", e);
|
||||
database.markAsDecryptFailed(messageId);
|
||||
return;
|
||||
} catch (DuplicateMessageException e) {
|
||||
Log.w("DecryptionQueue", e);
|
||||
database.markAsDecryptDuplicate(messageId);
|
||||
return;
|
||||
}
|
||||
|
||||
database.updateMessageBody(masterSecret, messageId, plaintextBody);
|
||||
|
||||
Reference in New Issue
Block a user