Start implementing the non-incremental sync portion of the v2 /sync API

This commit is contained in:
Mark Haines 2015-01-26 18:53:31 +00:00
parent 3186c5bdbc
commit 436513068d
4 changed files with 145 additions and 53 deletions

View file

@ -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