mirror of https://github.com/vector-im/riot-web
Fix EventIndex handling events twice
It awaits the decryption in onRoomTimeline as well as subscribing to EVent.decryptedpull/21833/head
parent
b0053f36d3
commit
923d68a0fa
|
@ -67,7 +67,6 @@ export default class EventIndex extends EventEmitter {
|
||||||
|
|
||||||
client.on('sync', this.onSync);
|
client.on('sync', this.onSync);
|
||||||
client.on('Room.timeline', this.onRoomTimeline);
|
client.on('Room.timeline', this.onRoomTimeline);
|
||||||
client.on('Event.decrypted', this.onEventDecrypted);
|
|
||||||
client.on('Room.timelineReset', this.onTimelineReset);
|
client.on('Room.timelineReset', this.onTimelineReset);
|
||||||
client.on('Room.redaction', this.onRedaction);
|
client.on('Room.redaction', this.onRedaction);
|
||||||
client.on('RoomState.events', this.onRoomStateEvent);
|
client.on('RoomState.events', this.onRoomStateEvent);
|
||||||
|
@ -82,7 +81,6 @@ export default class EventIndex extends EventEmitter {
|
||||||
|
|
||||||
client.removeListener('sync', this.onSync);
|
client.removeListener('sync', this.onSync);
|
||||||
client.removeListener('Room.timeline', this.onRoomTimeline);
|
client.removeListener('Room.timeline', this.onRoomTimeline);
|
||||||
client.removeListener('Event.decrypted', this.onEventDecrypted);
|
|
||||||
client.removeListener('Room.timelineReset', this.onTimelineReset);
|
client.removeListener('Room.timelineReset', this.onTimelineReset);
|
||||||
client.removeListener('Room.redaction', this.onRedaction);
|
client.removeListener('Room.redaction', this.onRedaction);
|
||||||
client.removeListener('RoomState.events', this.onRoomStateEvent);
|
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.
|
* The Room.redaction listener.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue