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
Check unsigned.age for getAge() for v2. Don't spam SYNCING emissions.
This commit is contained in:
@@ -143,7 +143,10 @@ module.exports.MatrixEvent.prototype = {
|
||||
* @return {Number} The age of this event in milliseconds.
|
||||
*/
|
||||
getAge: function() {
|
||||
return this.event.age;
|
||||
if (this.event.unsigned && this.event.unsigned.age) {
|
||||
return this.event.unsigned.age; // v2
|
||||
}
|
||||
return this.event.age; // v1
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user