You've already forked matrix-js-sdk
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:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user