mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-21 16:24:06 -04:00
Do not assume that the contents dictionary includes history_visibility. (#8945)
This commit is contained in:
parent
01333681bc
commit
be2db93b3c
9 changed files with 58 additions and 28 deletions
|
@ -34,7 +34,7 @@ from prometheus_client import Counter
|
|||
from twisted.internet import defer
|
||||
|
||||
import synapse.server
|
||||
from synapse.api.constants import EventTypes, Membership
|
||||
from synapse.api.constants import EventTypes, HistoryVisibility, Membership
|
||||
from synapse.api.errors import AuthError
|
||||
from synapse.events import EventBase
|
||||
from synapse.handlers.presence import format_user_presence_state
|
||||
|
@ -611,7 +611,9 @@ class Notifier:
|
|||
room_id, EventTypes.RoomHistoryVisibility, ""
|
||||
)
|
||||
if state and "history_visibility" in state.content:
|
||||
return state.content["history_visibility"] == "world_readable"
|
||||
return (
|
||||
state.content["history_visibility"] == HistoryVisibility.WORLD_READABLE
|
||||
)
|
||||
else:
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue