summary refs log tree commit diff
path: root/synapse/push/mailer.py
diff options
context:
space:
mode:
authorEric Eastwood <eric.eastwood@beta.gouv.fr>2024-06-24 10:02:16 -0500
committerGitHub <noreply@github.com>2024-06-24 10:02:16 -0500
commitae4c236a6d6ef76565240ac964c5f540b9c1e1ed (patch)
treefd103c638e5fe512d233249b60f181b79d3444c5 /synapse/push/mailer.py
parentReintroduce #17291. (#17338) (diff)
downloadsynapse-ae4c236a6d6ef76565240ac964c5f540b9c1e1ed.tar.xz
Fix room `type` typo in mailer (#17336)
Correct event content field is `EventContentFields.ROOM_TYPE` (`type`) :white_check_mark: , not `room_type` :x:

Spec: https://spec.matrix.org/v1.10/client-server-api/#mroomcreate
Diffstat (limited to '')
-rw-r--r--synapse/push/mailer.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py
index 77cc69a71f..cf611bd90b 100644
--- a/synapse/push/mailer.py
+++ b/synapse/push/mailer.py
@@ -28,7 +28,7 @@ import jinja2
 from markupsafe import Markup
 from prometheus_client import Counter
 
-from synapse.api.constants import EventTypes, Membership, RoomTypes
+from synapse.api.constants import EventContentFields, EventTypes, Membership, RoomTypes
 from synapse.api.errors import StoreError
 from synapse.config.emailconfig import EmailSubjectConfig
 from synapse.events import EventBase
@@ -716,7 +716,8 @@ class Mailer:
                 )
                 if (
                     create_event
-                    and create_event.content.get("room_type") == RoomTypes.SPACE
+                    and create_event.content.get(EventContentFields.ROOM_TYPE)
+                    == RoomTypes.SPACE
                 ):
                     return self.email_subjects.invite_from_person_to_space % {
                         "person": inviter_name,