Trigger EnvelopeEvent for unsealed envelopes
This commit is contained in:
parent
15fbbf0a67
commit
885b4d4d2e
3 changed files with 6 additions and 28 deletions
|
@ -305,10 +305,6 @@ export async function startApp(): Promise<void> {
|
|||
})
|
||||
);
|
||||
messageReceiver.addEventListener('empty', queuedEventListener(onEmpty));
|
||||
messageReceiver.addEventListener(
|
||||
'reconnect',
|
||||
queuedEventListener(onReconnect)
|
||||
);
|
||||
messageReceiver.addEventListener(
|
||||
'configuration',
|
||||
queuedEventListener(onConfiguration)
|
||||
|
@ -2395,18 +2391,6 @@ export async function startApp(): Promise<void> {
|
|||
await window.crashReports.getCount()
|
||||
);
|
||||
}
|
||||
function onReconnect() {
|
||||
// We disable notifications on first connect, but the same applies to reconnect. In
|
||||
// scenarios where we're coming back from sleep, we can get offline/online events
|
||||
// very fast, and it looks like a network blip. But we need to suppress
|
||||
// notifications in these scenarios too. So we listen for 'reconnect' events.
|
||||
profileKeyResponseQueue.pause();
|
||||
lightSessionResetQueue.pause();
|
||||
onDecryptionErrorQueue.pause();
|
||||
onRetryRequestQueue.pause();
|
||||
window.Whisper.deliveryReceiptQueue.pause();
|
||||
notificationService.disable();
|
||||
}
|
||||
|
||||
let initialStartupCount = 0;
|
||||
window.Whisper.events.on('incrementProgress', incrementProgress);
|
||||
|
|
|
@ -76,9 +76,9 @@ import type {
|
|||
ProcessedEnvelope,
|
||||
IRequestHandler,
|
||||
} from './Types.d';
|
||||
import type { ReconnectEvent, EnvelopeEvent } from './messageReceiverEvents';
|
||||
import {
|
||||
EmptyEvent,
|
||||
EnvelopeEvent,
|
||||
ProgressEvent,
|
||||
TypingEvent,
|
||||
ErrorEvent,
|
||||
|
@ -361,11 +361,6 @@ export default class MessageReceiver
|
|||
// EventTarget types
|
||||
//
|
||||
|
||||
public override addEventListener(
|
||||
name: 'reconnect',
|
||||
handler: (ev: ReconnectEvent) => void
|
||||
): void;
|
||||
|
||||
public override addEventListener(
|
||||
name: 'empty',
|
||||
handler: (ev: EmptyEvent) => void
|
||||
|
@ -1002,6 +997,11 @@ export default class MessageReceiver
|
|||
|
||||
logId = this.getEnvelopeId(unsealedEnvelope);
|
||||
|
||||
this.addToQueue(
|
||||
async () => this.dispatchEvent(new EnvelopeEvent(unsealedEnvelope)),
|
||||
TaskType.Decrypted
|
||||
);
|
||||
|
||||
return this.decryptEnvelope(stores, unsealedEnvelope, uuidKind);
|
||||
}, `MessageReceiver: unseal and decrypt ${logId}`);
|
||||
|
||||
|
|
|
@ -15,12 +15,6 @@ import type {
|
|||
ModifiedGroupDetails,
|
||||
} from './ContactsParser';
|
||||
|
||||
export class ReconnectEvent extends Event {
|
||||
constructor() {
|
||||
super('reconnect');
|
||||
}
|
||||
}
|
||||
|
||||
export class EmptyEvent extends Event {
|
||||
constructor() {
|
||||
super('empty');
|
||||
|
|
Loading…
Add table
Reference in a new issue