mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 10:52:14 -04:00
Move maybe_kick_guest_users
out of BaseHandler
(#10744)
This is part of my ongoing war against BaseHandler. I've moved kick_guest_users into RoomMemberHandler (since it calls out to that handler anyway), and split maybe_kick_guest_users into the two places it is called.
This commit is contained in:
parent
5e9b382505
commit
56e2a30634
9 changed files with 125 additions and 85 deletions
|
@ -19,7 +19,13 @@ from typing import TYPE_CHECKING, Optional, Tuple
|
|||
import msgpack
|
||||
from unpaddedbase64 import decode_base64, encode_base64
|
||||
|
||||
from synapse.api.constants import EventTypes, HistoryVisibility, JoinRules
|
||||
from synapse.api.constants import (
|
||||
EventContentFields,
|
||||
EventTypes,
|
||||
GuestAccess,
|
||||
HistoryVisibility,
|
||||
JoinRules,
|
||||
)
|
||||
from synapse.api.errors import (
|
||||
Codes,
|
||||
HttpResponseException,
|
||||
|
@ -336,8 +342,8 @@ class RoomListHandler(BaseHandler):
|
|||
guest_event = current_state.get((EventTypes.GuestAccess, ""))
|
||||
guest = None
|
||||
if guest_event:
|
||||
guest = guest_event.content.get("guest_access", None)
|
||||
result["guest_can_join"] = guest == "can_join"
|
||||
guest = guest_event.content.get(EventContentFields.GUEST_ACCESS)
|
||||
result["guest_can_join"] = guest == GuestAccess.CAN_JOIN
|
||||
|
||||
avatar_event = current_state.get(("m.room.avatar", ""))
|
||||
if avatar_event:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue