You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Switch callEventHandler from listening on event to Room.timeline
so that it doesn't end up processing ephemerals, account data, remote echoes, etc etc
This commit is contained in:
@@ -47,12 +47,12 @@ export class CallEventHandler {
|
|||||||
|
|
||||||
public start() {
|
public start() {
|
||||||
this.client.on("sync", this.evaluateEventBuffer);
|
this.client.on("sync", this.evaluateEventBuffer);
|
||||||
this.client.on("event", this.onEvent);
|
this.client.on("Room.timeline", this.onRoomTimeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
public stop() {
|
public stop() {
|
||||||
this.client.removeListener("sync", this.evaluateEventBuffer);
|
this.client.removeListener("sync", this.evaluateEventBuffer);
|
||||||
this.client.removeListener("event", this.onEvent);
|
this.client.removeListener("Room.timeline", this.onRoomTimeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
private evaluateEventBuffer = async () => {
|
private evaluateEventBuffer = async () => {
|
||||||
@@ -89,7 +89,7 @@ export class CallEventHandler {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private onEvent = (event: MatrixEvent) => {
|
private onRoomTimeline = (event: MatrixEvent) => {
|
||||||
this.client.decryptEventIfNeeded(event);
|
this.client.decryptEventIfNeeded(event);
|
||||||
// any call events or ones that might be once they're decrypted
|
// any call events or ones that might be once they're decrypted
|
||||||
if (this.eventIsACall(event) || event.isBeingDecrypted()) {
|
if (this.eventIsACall(event) || event.isBeingDecrypted()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user