1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Use getLocalAge() & add grace period

Use the new local-age field for deciding whether a call is still
valid or not. Also add a grace period so we don't ring half a second
before the call becomes invalid.
This commit is contained in:
David Baker
2020-10-08 11:49:54 +01:00
parent 92c6332143
commit f518ea95f4
2 changed files with 7 additions and 7 deletions

View File

@@ -433,7 +433,7 @@ export class MatrixCall extends EventEmitter {
this.type = CallType.Voice;
}
if (event.getAge()) {
if (event.getLocalAge()) {
setTimeout(() => {
if (this.state == CallState.Ringing) {
logger.debug("Call invite has expired. Hanging up.");
@@ -445,7 +445,7 @@ export class MatrixCall extends EventEmitter {
}
this.emit("hangup");
}
}, this.msg.lifetime - event.getAge());
}, this.msg.lifetime - event.getLocalAge());
}
}