Implement MSC3912: Relation-based redactions (#14260)

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
This commit is contained in:
Brendan Abolivier 2022-11-03 16:21:31 +00:00 committed by GitHub
parent e5cd278f3f
commit 86c5a710d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 486 additions and 28 deletions

View file

@ -410,6 +410,43 @@ class RestHelper:
return channel.json_body
def get_event(
self,
room_id: str,
event_id: str,
tok: Optional[str] = None,
expect_code: int = HTTPStatus.OK,
) -> JsonDict:
"""Request a specific event from the server.
Args:
room_id: the room in which the event was sent.
event_id: the event's ID.
tok: the token to request the event with.
expect_code: the expected HTTP status for the response.
Returns:
The event as a dict.
"""
path = f"/_matrix/client/v3/rooms/{room_id}/event/{event_id}"
if tok:
path = path + f"?access_token={tok}"
channel = make_request(
self.hs.get_reactor(),
self.site,
"GET",
path,
)
assert channel.code == expect_code, "Expected: %d, got: %d, resp: %r" % (
expect_code,
channel.code,
channel.result["body"],
)
return channel.json_body
def _read_write_state(
self,
room_id: str,