@@ -101,7 +101,7 @@ argument name and the function as its value. This is demonstrated in the example
101101The available spam checker callbacks are :
102102
103103` ` ` python
104- def check_event_for_spam(event: "synapse.events.EventBase") -> Union[bool, str]
104+ async def check_event_for_spam(event: "synapse.events.EventBase") -> Union[bool, str]
105105` ` `
106106
107107Called when receiving an event from a client or via federation. The module can return
@@ -110,38 +110,38 @@ to indicate the event must be rejected because of spam and to give a rejection r
110110forward to clients.
111111
112112` ` ` python
113- def user_may_invite(inviter: str, invitee: str, room_id: str) -> bool
113+ async def user_may_invite(inviter: str, invitee: str, room_id: str) -> bool
114114` ` `
115115
116116Called when processing an invitation. The module must return a `bool` indicating whether
117117the inviter can invite the invitee to the given room. Both inviter and invitee are
118118represented by their Matrix user ID (i.e. `@alice:example.com`).
119119
120120` ` ` python
121- def user_may_create_room(user: str) -> bool
121+ async def user_may_create_room(user: str) -> bool
122122` ` `
123123
124124Called when processing a room creation request. The module must return a `bool` indicating
125125whether the given user (represented by their Matrix user ID) is allowed to create a room.
126126
127127` ` ` python
128- def user_may_create_room_alias(user: str, room_alias: "synapse.types.RoomAlias") -> bool
128+ async def user_may_create_room_alias(user: str, room_alias: "synapse.types.RoomAlias") -> bool
129129` ` `
130130
131131Called when trying to associate an alias with an existing room. The module must return a
132132` bool` indicating whether the given user (represented by their Matrix user ID) is allowed
133133to set the given alias.
134134
135135` ` ` python
136- def user_may_publish_room(user: str, room_id: str) -> bool
136+ async def user_may_publish_room(user: str, room_id: str) -> bool
137137` ` `
138138
139139Called when trying to publish a room to the homeserver's public rooms directory. The
140140module must return a `bool` indicating whether the given user (represented by their
141141Matrix user ID) is allowed to publish the given room.
142142
143143` ` ` python
144- def check_username_for_spam(user_profile: Dict[str, str]) -> bool
144+ async def check_username_for_spam(user_profile: Dict[str, str]) -> bool
145145` ` `
146146
147147Called when computing search results in the user directory. The module must return a
@@ -156,7 +156,7 @@ The module is given a copy of the original dictionary, so modifying it from with
156156module cannot modify a user's profile when included in user directory search results.
157157
158158` ` ` python
159- def check_registration_for_spam(
159+ async def check_registration_for_spam(
160160 email_threepid: Optional[dict],
161161 username: Optional[str],
162162 request_info: Collection[Tuple[str, str]],
@@ -179,7 +179,7 @@ The arguments passed to this callback are:
179179* `auth_provider_id`: The identifier of the SSO authentication provider, if any.
180180
181181` ` ` python
182- def check_media_file_for_spam(
182+ async def check_media_file_for_spam(
183183 file_wrapper: "synapse.rest.media.v1.media_storage.ReadableFileWrapper",
184184 file_info: "synapse.rest.media.v1._base.FileInfo"
185185) -> bool
0 commit comments