Extra toast for Message Receiver errors
This commit is contained in:
parent
36b3e2de08
commit
ca4aad6bad
4 changed files with 96 additions and 11 deletions
|
@ -29,6 +29,7 @@ import type { ConversationModel } from '../models/conversations';
|
|||
import type {
|
||||
DecryptionErrorEvent,
|
||||
DecryptionErrorEventData,
|
||||
InvalidPlaintextEvent,
|
||||
RetryRequestEvent,
|
||||
RetryRequestEventData,
|
||||
} from '../textsecure/messageReceiverEvents';
|
||||
|
@ -205,6 +206,23 @@ function maybeShowDecryptionToast(
|
|||
});
|
||||
}
|
||||
|
||||
export function onInvalidPlaintextMessage({
|
||||
data,
|
||||
}: InvalidPlaintextEvent): void {
|
||||
const { senderUuid, senderDevice, timestamp } = data;
|
||||
const logId = `${senderUuid}.${senderDevice} ${timestamp}`;
|
||||
|
||||
log.info(`onInvalidPlaintextMessage/${logId}: Starting...`);
|
||||
|
||||
const conversation = window.ConversationController.getOrCreate(
|
||||
senderUuid,
|
||||
'private'
|
||||
);
|
||||
|
||||
const name = conversation.getTitle();
|
||||
maybeShowDecryptionToast(logId, name, senderDevice);
|
||||
}
|
||||
|
||||
export async function onDecryptionError(
|
||||
event: DecryptionErrorEvent
|
||||
): Promise<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue