Consider all messages without contentHint, from us, to be resendable

This commit is contained in:
Scott Nonnenberg 2023-04-18 15:49:14 -07:00 committed by GitHub
parent a532cb41c2
commit 850442bf2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -1209,7 +1209,6 @@ function saveDraft(
messageText !== conversation.get('draft') ||
!isEqual(bodyRanges, conversation.get('draftBodyRanges'))
) {
log.info(`saveDraft(${conversation.idForLogging()})`);
const now = Date.now();
let activeAt = conversation.get('active_at');
let timestamp = conversation.get('timestamp');

View file

@ -13,6 +13,7 @@ import type {
UnidentifiedSenderMessageContent,
} from '@signalapp/libsignal-client';
import {
ContentHint,
CiphertextMessageType,
DecryptionErrorMessage,
groupDecrypt,
@ -1890,6 +1891,9 @@ export default class MessageReceiver
const uuid = envelope.sourceUuid;
const deviceId = envelope.sourceDevice;
const ourUuid = this.storage.user.getCheckedUuid().toString();
const isFromMe = ourUuid === uuid;
// Job timed out, not a decryption error
if (
error?.name === 'TimeoutError' ||
@ -1931,7 +1935,9 @@ export default class MessageReceiver
{
cipherTextBytes,
cipherTextType,
contentHint: envelope.contentHint,
contentHint:
envelope.contentHint ??
(isFromMe ? ContentHint.Resendable : undefined),
groupId: envelope.groupId,
receivedAtCounter: envelope.receivedAtCounter,
receivedAtDate: envelope.receivedAtDate,