mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 22:54:58 -04:00
Correctly handle the 'age' key in events and pdus
This commit is contained in:
parent
76217890c0
commit
5bd9369a62
10 changed files with 51 additions and 15 deletions
|
@ -59,6 +59,14 @@ class EventFactory(object):
|
|||
if "ts" not in kwargs:
|
||||
kwargs["ts"] = int(self.clock.time_msec())
|
||||
|
||||
# The "age" key is a delta timestamp that should be converted into an
|
||||
# absolute timestamp the minute we see it.
|
||||
if "age" in kwargs:
|
||||
kwargs["age_ts"] = int(self.clock.time_msec()) - int(kwargs["age"])
|
||||
del kwargs["age"]
|
||||
elif "age_ts" not in kwargs:
|
||||
kwargs["age_ts"] = int(self.clock.time_msec())
|
||||
|
||||
if etype in self._event_list:
|
||||
handler = self._event_list[etype]
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue