diff options
author | Erik Johnston <erikj@jki.re> | 2019-01-29 21:40:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-29 21:40:00 +0000 |
commit | 6f9cdc2d47239f6cb7596a2a875379287a8fe83a (patch) | |
tree | 0edf9ec31f152ef45541b16ff9ed4a3c68bac142 /synapse/events/utils.py | |
parent | Merge pull request #4512 from matrix-org/anoa/consent_dir (diff) | |
parent | Newsfile (diff) | |
download | synapse-6f9cdc2d47239f6cb7596a2a875379287a8fe83a.tar.xz |
Merge pull request #4483 from matrix-org/erikj/event_v2
Implement event format V2
Diffstat (limited to 'synapse/events/utils.py')
-rw-r--r-- | synapse/events/utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/events/utils.py b/synapse/events/utils.py index 63f693f259..07fccdd8f9 100644 --- a/synapse/events/utils.py +++ b/synapse/events/utils.py @@ -267,6 +267,7 @@ def serialize_event(e, time_now_ms, as_client_event=True, Returns: dict """ + # FIXME(erikj): To handle the case of presence events and the like if not isinstance(e, EventBase): return e @@ -276,6 +277,8 @@ def serialize_event(e, time_now_ms, as_client_event=True, # Should this strip out None's? d = {k: v for k, v in e.get_dict().items()} + d["event_id"] = e.event_id + if "age_ts" in d["unsigned"]: d["unsigned"]["age"] = time_now_ms - d["unsigned"]["age_ts"] del d["unsigned"]["age_ts"] |