summary refs log tree commit diff
path: root/synapse/events/utils.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2016-11-22 09:59:27 +0000
committerKegan Dougal <kegan@matrix.org>2016-11-22 09:59:27 +0000
commit0a8b0eeca17442a839d9f3a8624e331604b74711 (patch)
tree4e516a1408ed8cedfc6d368afb0d16940382c5ed /synapse/events/utils.py
parentAdd remaining tests (diff)
downloadsynapse-0a8b0eeca17442a839d9f3a8624e331604b74711.tar.xz
More tests
Diffstat (limited to 'synapse/events/utils.py')
-rw-r--r--synapse/events/utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/events/utils.py b/synapse/events/utils.py
index a14d9bd0ca..9a700d39bb 100644
--- a/synapse/events/utils.py
+++ b/synapse/events/utils.py
@@ -229,7 +229,7 @@ def format_event_for_client_v2_without_room_id(d):
 
 def serialize_event(e, time_now_ms, as_client_event=True,
                     event_format=format_event_for_client_v1,
-                    token_id=None, event_fields=None):
+                    token_id=None, only_event_fields=None):
     # FIXME(erikj): To handle the case of presence events and the like
     if not isinstance(e, EventBase):
         return e
@@ -258,7 +258,8 @@ def serialize_event(e, time_now_ms, as_client_event=True,
     if as_client_event:
         d = event_format(d)
 
-    if isinstance(event_fields, list):
-        d = only_fields(d, event_fields)
+    if (isinstance(only_event_fields, list) and
+            all(isinstance(f, basestring) for f in only_event_fields)):
+        d = only_fields(d, only_event_fields)
 
     return d