mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 09:56:05 -04:00
Add 'raw' query parameter to expose the event graph and signatures to savvy clients.
This commit is contained in:
parent
d44dd47fbf
commit
5720ab59e0
6 changed files with 28 additions and 16 deletions
|
@ -89,7 +89,7 @@ def prune_event(event):
|
|||
return type(event)(allowed_fields)
|
||||
|
||||
|
||||
def serialize_event(hs, e):
|
||||
def serialize_event(hs, e, remove_data=True):
|
||||
# FIXME(erikj): To handle the case of presence events and the like
|
||||
if not isinstance(e, EventBase):
|
||||
return e
|
||||
|
@ -122,12 +122,13 @@ def serialize_event(hs, e):
|
|||
d["prev_content"] = e.unsigned["prev_content"]
|
||||
del d["unsigned"]["prev_content"]
|
||||
|
||||
del d["auth_events"]
|
||||
del d["prev_events"]
|
||||
del d["hashes"]
|
||||
del d["signatures"]
|
||||
d.pop("depth", None)
|
||||
d.pop("unsigned", None)
|
||||
d.pop("origin", None)
|
||||
if remove_data:
|
||||
del d["auth_events"]
|
||||
del d["prev_events"]
|
||||
del d["hashes"]
|
||||
del d["signatures"]
|
||||
d.pop("depth", None)
|
||||
d.pop("unsigned", None)
|
||||
d.pop("origin", None)
|
||||
|
||||
return d
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue