summary refs log tree commit diff
path: root/synapse/events/utils.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-01-26 18:53:31 +0000
committerMark Haines <mark.haines@matrix.org>2015-01-26 18:53:31 +0000
commit436513068de73ab47d9ba9a32046420be3d86588 (patch)
tree07fb90a26067ed1f015ff77aa659d9a9d3104b8d /synapse/events/utils.py
parentMerge branch 'develop' into client_v2_sync (diff)
downloadsynapse-436513068de73ab47d9ba9a32046420be3d86588.tar.xz
Start implementing the non-incremental sync portion of the v2 /sync API
Diffstat (limited to 'synapse/events/utils.py')
-rw-r--r--synapse/events/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/events/utils.py b/synapse/events/utils.py
index e391aca4cc..b7f1ad4b40 100644
--- a/synapse/events/utils.py
+++ b/synapse/events/utils.py
@@ -89,7 +89,7 @@ def prune_event(event):
     return type(event)(allowed_fields)
 
 
-def serialize_event(e, time_now_ms, client_event=True):
+def serialize_event(e, time_now_ms, client_event=True, strip_ids=False):
     # FIXME(erikj): To handle the case of presence events and the like
     if not isinstance(e, EventBase):
         return e
@@ -138,4 +138,8 @@ def serialize_event(e, time_now_ms, client_event=True):
     d.pop("unsigned", None)
     d.pop("origin", None)
 
+    if strip_ids:
+        d.pop("room_id", None)
+        d.pop("event_id", None)
+
     return d