mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:16:09 -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
|
@ -46,7 +46,8 @@ class EventStreamHandler(BaseHandler):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
@log_function
|
||||
def get_stream(self, auth_user_id, pagin_config, timeout=0):
|
||||
def get_stream(self, auth_user_id, pagin_config, timeout=0,
|
||||
trim_events=True):
|
||||
auth_user = self.hs.parse_userid(auth_user_id)
|
||||
|
||||
try:
|
||||
|
@ -78,7 +79,9 @@ class EventStreamHandler(BaseHandler):
|
|||
auth_user, room_ids, pagin_config, timeout
|
||||
)
|
||||
|
||||
chunks = [self.hs.serialize_event(e) for e in events]
|
||||
chunks = [
|
||||
self.hs.serialize_event(e, trim_events) for e in events
|
||||
]
|
||||
|
||||
chunk = {
|
||||
"chunk": chunks,
|
||||
|
|
|
@ -211,7 +211,7 @@ class MessageHandler(BaseHandler):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def snapshot_all_rooms(self, user_id=None, pagin_config=None,
|
||||
feedback=False):
|
||||
feedback=False, trim_events=True):
|
||||
"""Retrieve a snapshot of all rooms the user is invited or has joined.
|
||||
|
||||
This snapshot may include messages for all rooms where the user is
|
||||
|
@ -280,7 +280,9 @@ class MessageHandler(BaseHandler):
|
|||
end_token = now_token.copy_and_replace("room_key", token[1])
|
||||
|
||||
d["messages"] = {
|
||||
"chunk": [self.hs.serialize_event(m) for m in messages],
|
||||
"chunk": [
|
||||
self.hs.serialize_event(m, trim_events) for m in messages
|
||||
],
|
||||
"start": start_token.to_string(),
|
||||
"end": end_token.to_string(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue