requestResend: Show decryption error toast only for RESENDABLE/DEFAULT
This commit is contained in:
parent
db0c9f0f49
commit
3d8976d030
1 changed files with 9 additions and 6 deletions
|
@ -37,7 +37,7 @@ export async function onRetryRequest(event: RetryRequestEvent): Promise<void> {
|
||||||
senderDevice,
|
senderDevice,
|
||||||
sentAt,
|
sentAt,
|
||||||
} = retryRequest;
|
} = retryRequest;
|
||||||
const logId = `${requesterUuid}.${requesterDevice} ${sentAt}-${senderDevice}`;
|
const logId = `${requesterUuid}.${requesterDevice} ${sentAt}.${senderDevice}`;
|
||||||
|
|
||||||
window.log.info(`onRetryRequest/${logId}: Starting...`);
|
window.log.info(`onRetryRequest/${logId}: Starting...`);
|
||||||
|
|
||||||
|
@ -128,7 +128,9 @@ function maybeShowDecryptionToast(logId: string) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.log.info(`onDecryptionError/${logId}: Showing decryption error toast`);
|
window.log.info(
|
||||||
|
`maybeShowDecryptionToast/${logId}: Showing decryption error toast`
|
||||||
|
);
|
||||||
window.Whisper.ToastView.show(
|
window.Whisper.ToastView.show(
|
||||||
window.Whisper.DecryptionErrorToast,
|
window.Whisper.DecryptionErrorToast,
|
||||||
document.getElementsByClassName('conversation-stack')[0]
|
document.getElementsByClassName('conversation-stack')[0]
|
||||||
|
@ -152,6 +154,8 @@ export async function onDecryptionError(
|
||||||
await conversation.getProfiles();
|
await conversation.getProfiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
maybeShowDecryptionToast(logId);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
conversation.get('capabilities')?.senderKey &&
|
conversation.get('capabilities')?.senderKey &&
|
||||||
RemoteConfig.isEnabled('desktop.senderKey.retry')
|
RemoteConfig.isEnabled('desktop.senderKey.retry')
|
||||||
|
@ -460,16 +464,15 @@ async function requestResend(decryptionError: DecryptionErrorEventData) {
|
||||||
wasOpened,
|
wasOpened,
|
||||||
});
|
});
|
||||||
|
|
||||||
maybeShowDecryptionToast(logId);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This message cannot be resent. We'll show no error and trust the other side to
|
// This message cannot be resent. We'll show no error and trust the other side to
|
||||||
// reset their session.
|
// reset their session.
|
||||||
if (contentHint === ContentHint.IMPLICIT) {
|
if (contentHint === ContentHint.IMPLICIT) {
|
||||||
maybeShowDecryptionToast(logId);
|
window.log.info(
|
||||||
|
`requestResend/${logId}: contentHint is IMPLICIT, doing nothing.`
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue