Use message age to expire old incoming calls

This commit is contained in:
Jim Gustafson 2020-06-25 14:42:32 -07:00 committed by Scott Nonnenberg
parent 870a0d2b65
commit e87a0103cc
3 changed files with 35 additions and 5 deletions

View file

@ -165,11 +165,7 @@ export class CallingClass {
return;
}
const now = new Date();
const serverTimestamp = envelope.serverTimestamp
? envelope.serverTimestamp
: now.valueOf();
const messageAgeSec = Math.floor((now.valueOf() - serverTimestamp) / 1000);
const messageAgeSec = envelope.messageAgeSec ? envelope.messageAgeSec : 0;
RingRTC.handleCallingMessage(
remoteUserId,