summary refs log tree commit diff
path: root/synapse/events/utils.py
diff options
context:
space:
mode:
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