mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 12:24:58 -04:00
Uniformize spam-checker API, part 5: expand other spam-checker callbacks to return Tuple[Codes, dict]
(#13044)
Signed-off-by: David Teller <davidt@element.io> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
This commit is contained in:
parent
d736d5cfad
commit
11f811470f
12 changed files with 426 additions and 60 deletions
|
@ -440,7 +440,12 @@ class RoomCreationHandler:
|
|||
|
||||
spam_check = await self.spam_checker.user_may_create_room(user_id)
|
||||
if spam_check != NOT_SPAM:
|
||||
raise SynapseError(403, "You are not permitted to create rooms", spam_check)
|
||||
raise SynapseError(
|
||||
403,
|
||||
"You are not permitted to create rooms",
|
||||
errcode=spam_check[0],
|
||||
additional_fields=spam_check[1],
|
||||
)
|
||||
|
||||
creation_content: JsonDict = {
|
||||
"room_version": new_room_version.identifier,
|
||||
|
@ -731,7 +736,10 @@ class RoomCreationHandler:
|
|||
spam_check = await self.spam_checker.user_may_create_room(user_id)
|
||||
if spam_check != NOT_SPAM:
|
||||
raise SynapseError(
|
||||
403, "You are not permitted to create rooms", spam_check
|
||||
403,
|
||||
"You are not permitted to create rooms",
|
||||
errcode=spam_check[0],
|
||||
additional_fields=spam_check[1],
|
||||
)
|
||||
|
||||
if ratelimit:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue