summary refs log tree commit diff
path: root/synapse/event_auth.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-09-08 10:00:43 -0400
committerGitHub <noreply@github.com>2021-09-08 10:00:43 -0400
commit0288e6033b08149867e742283bb0139f10b66b01 (patch)
tree968d6379f70b6d30c4ba861bf2cd3fc1db61df10 /synapse/event_auth.py
parentChange logging of puppeted requests to better differentiate users (#10779) (diff)
downloadsynapse-0288e6033b08149867e742283bb0139f10b66b01.tar.xz
Add a constant for m.federate. (#10775)
Diffstat (limited to 'synapse/event_auth.py')
-rw-r--r--synapse/event_auth.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/event_auth.py b/synapse/event_auth.py
index b63a1afe93..cb133f3f84 100644
--- a/synapse/event_auth.py
+++ b/synapse/event_auth.py
@@ -21,7 +21,13 @@ from signedjson.key import decode_verify_key_bytes
 from signedjson.sign import SignatureVerifyException, verify_signed_json
 from unpaddedbase64 import decode_base64
 
-from synapse.api.constants import MAX_PDU_SIZE, EventTypes, JoinRules, Membership
+from synapse.api.constants import (
+    MAX_PDU_SIZE,
+    EventContentFields,
+    EventTypes,
+    JoinRules,
+    Membership,
+)
 from synapse.api.errors import AuthError, EventSizeError, SynapseError
 from synapse.api.room_versions import (
     KNOWN_ROOM_VERSIONS,
@@ -236,7 +242,7 @@ def _can_federate(event: EventBase, auth_events: StateMap[EventBase]) -> bool:
     if not creation_event:
         return False
 
-    return creation_event.content.get("m.federate", True) is True
+    return creation_event.content.get(EventContentFields.FEDERATE, True) is True
 
 
 def _is_membership_change_allowed(