downgrade duplicated error message and fixing new upload of message

This commit is contained in:
otsmr 2026-04-24 23:38:07 +02:00
parent e8d8e8b160
commit 3c91f99008
2 changed files with 12 additions and 2 deletions

View file

@ -226,11 +226,15 @@ Future<(EncryptedContent?, PlaintextContent?)> handleEncryptedMessageRaw(
);
if (encryptedContent == null) {
if (decryptionErrorType == null) {
// Duplicate message
return (null, null);
}
return (
null,
PlaintextContent()
..decryptionErrorMessage = (PlaintextContent_DecryptionErrorMessage()
..type = decryptionErrorType!),
..type = decryptionErrorType),
);
}

View file

@ -59,7 +59,13 @@ signalDecryptMessage(
return (EncryptedContent.fromBuffer(plaintext), null);
} on InvalidKeyIdException catch (e) {
Log.warn(e);
return (null, PlaintextContent_DecryptionErrorMessage_Type.PREKEY_UNKNOWN);
return (
null,
PlaintextContent_DecryptionErrorMessage_Type.PREKEY_UNKNOWN,
);
} on DuplicateMessageException catch (e) {
Log.info(e.toString());
return (null, null);
} on InvalidMessageException catch (e) {
if (!resyncedUsers.contains(fromUserId)) {
if (await handleSessionResync(fromUserId)) {