diff options
author | Erik Johnston <erik@matrix.org> | 2014-09-23 15:28:32 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-09-23 15:28:32 +0100 |
commit | 78af6bbb981c41e5509c99454deb7205c31bf964 (patch) | |
tree | 50dcd73e748b2807e22752f59bb940dd420078cb /synapse/api/events/__init__.py | |
parent | Add a deletions table (diff) | |
download | synapse-78af6bbb981c41e5509c99454deb7205c31bf964.tar.xz |
Add m.room.deletion. If an event is deleted it will be returned to clients 'pruned', i.e. all client specified keys will be removed.
Diffstat (limited to 'synapse/api/events/__init__.py')
-rw-r--r-- | synapse/api/events/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/api/events/__init__.py b/synapse/api/events/__init__.py index 0cee196851..910c990b33 100644 --- a/synapse/api/events/__init__.py +++ b/synapse/api/events/__init__.py @@ -22,7 +22,7 @@ def serialize_event(hs, e): if not isinstance(e, SynapseEvent): return e - d = e.get_dict() + d = {k: v for k, v in e.get_dict().items() if v is not None or v is not False} if "age_ts" in d: d["age"] = int(hs.get_clock().time_msec()) - d["age_ts"] del d["age_ts"] @@ -58,17 +58,19 @@ class SynapseEvent(JsonEncodedObject): "required_power_level", "age_ts", "prev_content", + "prev_state", + "pruned", ] internal_keys = [ "is_state", "prev_events", - "prev_state", "depth", "destinations", "origin", "outlier", "power_level", + "deleted", ] required_keys = [ |