diff --git a/changelog.d/437.feature b/changelog.d/437.feature new file mode 100644 index 00000000..dd281090 --- /dev/null +++ b/changelog.d/437.feature @@ -0,0 +1 @@ +Support the stable room type field for [MSC3288](https://github.com/matrix-org/matrix-doc/pull/3288). diff --git a/sydent/http/servlets/store_invite_servlet.py b/sydent/http/servlets/store_invite_servlet.py index ada6506a..a344a603 100644 --- a/sydent/http/servlets/store_invite_servlet.py +++ b/sydent/http/servlets/store_invite_servlet.py @@ -125,10 +125,12 @@ def render_POST(self, request: Request) -> JsonDict: for k in extra_substitutions: substitutions.setdefault(k, "") - # MSC3288 - substitutions["room_type"] = substitutions.get( - "org.matrix.msc3288.room_type", "" - ) + # For MSC3288 room type, prefer the stable field, but fallback to the + # unstable field. + if "room_type" not in substitutions: + substitutions["room_type"] = substitutions.get( + "org.matrix.msc3288.room_type", "" + ) substitutions["bracketed_verified_sender"] = "" if verified_sender: