summary refs log tree commit diff
path: root/synapse/notifier.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-12-16 08:46:37 -0500
committerGitHub <noreply@github.com>2020-12-16 08:46:37 -0500
commitbe2db93b3c14396d53d30f8d5f92db014453487b (patch)
tree45d487763583c8791da8f62f9e9949f72ee21edb /synapse/notifier.py
parentPreparatory refactoring of the SamlHandlerTestCase (#8938) (diff)
downloadsynapse-be2db93b3c14396d53d30f8d5f92db014453487b.tar.xz
Do not assume that the contents dictionary includes history_visibility. (#8945)
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r--synapse/notifier.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index a17352ef46..c4c8bb271d 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -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