diff options
author | Richard van der Hoff <richard@matrix.org> | 2019-12-18 09:51:51 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2019-12-18 09:51:51 +0000 |
commit | 6e8f8e14f272a5de61de675f6a01a5e1fc834c41 (patch) | |
tree | 5cc934c1e024e101cde67f698ee5b957101942b3 /synapse/handlers | |
parent | Remove unused `get_pagination_rows` methods. (#6557) (diff) | |
parent | Fix bug where we added duplicate event IDs as auth_events (#6560) (diff) | |
download | synapse-6e8f8e14f272a5de61de675f6a01a5e1fc834c41.tar.xz |
Merge release-v1.7.1 into develop
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/federation.py | 1 | ||||
-rw-r--r-- | synapse/handlers/room.py | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 3fccccfecd..60bb00fc6a 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -671,6 +671,7 @@ class FederationHandler(BaseHandler): bad_room_id, room_id, ) + del fetched_events[bad_event_id] return fetched_events diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 2d7925547d..d3a1a7b4a6 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -907,7 +907,10 @@ class RoomContextHandler(object): results["events_before"] = yield filter_evts(results["events_before"]) results["events_after"] = yield filter_evts(results["events_after"]) - results["event"] = event + # filter_evts can return a pruned event in case the user is allowed to see that + # there's something there but not see the content, so use the event that's in + # `filtered` rather than the event we retrieved from the datastore. + results["event"] = filtered[0] if results["events_after"]: last_event_id = results["events_after"][-1].event_id @@ -938,7 +941,7 @@ class RoomContextHandler(object): if event_filter: state_events = event_filter.filter(state_events) - results["state"] = state_events + results["state"] = yield filter_evts(state_events) # We use a dummy token here as we only care about the room portion of # the token, which we replace. |