Skip to content

Commit

Permalink
Don't ignore call member events with a distant future expiration date (
Browse files Browse the repository at this point in the history
…#2466)

to match updates to MSC3401
  • Loading branch information
robintown authored Jun 16, 2022
1 parent 70449ea commit df9ffdc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/webrtc/groupCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit df9ffdc

Please sign in to comment.