mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 22:44:49 -04:00
Allow sending a membership event to unban a user (#10807)
* Allow membership event to unban user Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
parent
f455b0e420
commit
6a751ff5e0
4 changed files with 99 additions and 2 deletions
|
@ -138,6 +138,7 @@ class RestHelper:
|
|||
extra_data: Optional[dict] = None,
|
||||
tok: Optional[str] = None,
|
||||
expect_code: int = 200,
|
||||
expect_errcode: str = None,
|
||||
) -> None:
|
||||
"""
|
||||
Send a membership state event into a room.
|
||||
|
@ -150,6 +151,7 @@ class RestHelper:
|
|||
extra_data: Extra information to include in the content of the event
|
||||
tok: The user access token to use
|
||||
expect_code: The expected HTTP response code
|
||||
expect_errcode: The expected Matrix error code
|
||||
"""
|
||||
temp_id = self.auth_user_id
|
||||
self.auth_user_id = src
|
||||
|
@ -177,6 +179,15 @@ class RestHelper:
|
|||
channel.result["body"],
|
||||
)
|
||||
|
||||
if expect_errcode:
|
||||
assert (
|
||||
str(channel.json_body["errcode"]) == expect_errcode
|
||||
), "Expected: %r, got: %r, resp: %r" % (
|
||||
expect_errcode,
|
||||
channel.json_body["errcode"],
|
||||
channel.result["body"],
|
||||
)
|
||||
|
||||
self.auth_user_id = temp_id
|
||||
|
||||
def send(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue