Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Remove origin_server_ts in favor of spec'ed ts query param
Browse files Browse the repository at this point in the history
Also edits for TARDIS visualation: matrix-org/tardis#1
  • Loading branch information
MadLittleMods committed Feb 2, 2021
1 parent c0b0936 commit bf90053
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
14 changes: 7 additions & 7 deletions synapse/events/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ def format_event_for_client_v1(d):

def format_event_for_client_v2(d):
drop_keys = (
"auth_events",
"prev_events",
"hashes",
"signatures",
"depth",
"origin",
"prev_state",
# "auth_events",
# "prev_events",
# "hashes",
# "signatures",
# "depth",
# "origin",
# "prev_state",
)
for key in drop_keys:
d.pop(key, None)
Expand Down
10 changes: 1 addition & 9 deletions synapse/rest/client/v1/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ async def on_POST(self, request, room_id, event_type, txn_id=None):
requester = await self.auth.get_user_by_req(request, allow_guest=True)
content = parse_json_object_from_request(request)
prev_events = parse_strings_from_args(request.args, "prev_event")
origin_server_ts = parse_integer(request, "origin_server_ts")

event_dict = {
"type": event_type,
Expand All @@ -237,14 +236,7 @@ async def on_POST(self, request, room_id, event_type, txn_id=None):
if prev_events:
event_dict["prev_events"] = prev_events

# TODO: Add `and requester.app_service`
if origin_server_ts:
event_dict["origin_server_ts"] = origin_server_ts

# TODO: I noticed in the Synapse code that we already accept a `ts` query parameter to override
# the `origin_server_ts` if the request is coming from an app service.
# Do we want to remove in favor of the spec'ed code above
if b"ts" in request.args and requester.app_service:
if b"ts" in request.args: # and requester.app_service:
event_dict["origin_server_ts"] = parse_integer(request, "ts", 0)

try:
Expand Down

0 comments on commit bf90053

Please sign in to comment.