Skip to content

Commit

Permalink
Fix room type typo in mailer (#17336)
Browse files Browse the repository at this point in the history
Correct event content field is `EventContentFields.ROOM_TYPE` (`type`) ✅ , not `room_type` ❌

Spec: https://spec.matrix.org/v1.10/client-server-api/#mroomcreate
  • Loading branch information
MadLittleMods authored Jun 24, 2024
1 parent 930a64b commit ae4c236
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/17336.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix email notification subject when invited to a space.
5 changes: 3 additions & 2 deletions synapse/push/mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
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
Expand Down Expand Up @@ -716,7 +716,8 @@ async def _make_summary_text_single_room(
)
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,
Expand Down

0 comments on commit ae4c236

Please sign in to comment.