Don't ignore call member events with a distant future expiration date (#2466)

to match updates to MSC3401
This commit is contained in:
Robin
2022-06-16 12:55:37 -04:00
committed by GitHub
parent 70449ea003
commit df9ffdc408
+1 -2
View File
@@ -139,8 +139,7 @@ const callMemberStateIsExpired = (event: MatrixEvent): boolean => {
const now = Date.now();
const content = event?.getContent<IGroupCallRoomMemberState>() ?? {};
const expiresAt = typeof content["m.expires_ts"] === "number" ? content["m.expires_ts"] : -Infinity;
// The event is expired if the expiration date has passed, or if it's unreasonably far in the future
return expiresAt <= now || expiresAt > now + CALL_MEMBER_STATE_TIMEOUT * 5 / 4;
return expiresAt <= now;
};
function getCallUserId(call: MatrixCall): string | null {