mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-19 05:21:22 +02:00
Fix EventIndex handling events twice
It awaits the decryption in onRoomTimeline as well as subscribing to EVent.decrypted
This commit is contained in:
parent
b0053f36d3
commit
923d68a0fa
@ -67,7 +67,6 @@ export default class EventIndex extends EventEmitter {
|
||||
|
||||
client.on('sync', this.onSync);
|
||||
client.on('Room.timeline', this.onRoomTimeline);
|
||||
client.on('Event.decrypted', this.onEventDecrypted);
|
||||
client.on('Room.timelineReset', this.onTimelineReset);
|
||||
client.on('Room.redaction', this.onRedaction);
|
||||
client.on('RoomState.events', this.onRoomStateEvent);
|
||||
@ -82,7 +81,6 @@ export default class EventIndex extends EventEmitter {
|
||||
|
||||
client.removeListener('sync', this.onSync);
|
||||
client.removeListener('Room.timeline', this.onRoomTimeline);
|
||||
client.removeListener('Event.decrypted', this.onEventDecrypted);
|
||||
client.removeListener('Room.timelineReset', this.onTimelineReset);
|
||||
client.removeListener('Room.redaction', this.onRedaction);
|
||||
client.removeListener('RoomState.events', this.onRoomStateEvent);
|
||||
@ -221,18 +219,6 @@ export default class EventIndex extends EventEmitter {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* The Event.decrypted listener.
|
||||
*
|
||||
* Checks if the event was marked for addition in the Room.timeline
|
||||
* listener, if so queues it up to be added to the index.
|
||||
*/
|
||||
private onEventDecrypted = async (ev: MatrixEvent, err: Error) => {
|
||||
// If the event isn't in our live event set, ignore it.
|
||||
if (err) return;
|
||||
await this.addLiveEventToIndex(ev);
|
||||
};
|
||||
|
||||
/*
|
||||
* The Room.redaction listener.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user