Skip to content
Snippets Groups Projects
Commit 39585bf5 authored by Erik Johnston's avatar Erik Johnston
Browse files

Insert 'age' into top level when returning events to clients

parent f3467d46
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,7 @@ def serialize_event(hs, e):
d = {k: v for k, v in e.get_dict().items()}
if "age_ts" in d["unsigned"]:
now = int(hs.get_clock().time_msec())
d["unsigned"]["age"] = now - d["unsigned"]["age_ts"]
d["age"] = now - d["unsigned"]["age_ts"]
del d["unsigned"]["age_ts"]
d["user_id"] = d.pop("sender", None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment