Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Send unstable-prefixed room_type in store-invite IS API requests #10435

Merged
merged 11 commits into from
Aug 4, 2021
3 changes: 3 additions & 0 deletions synapse/handlers/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ async def ask_id_server_for_third_party_invite(
room_avatar_url: str,
room_join_rules: str,
room_name: str,
room_type: str,
inviter_display_name: str,
inviter_avatar_url: str,
id_access_token: Optional[str] = None,
Expand All @@ -843,6 +844,7 @@ async def ask_id_server_for_third_party_invite(
notifications.
room_join_rules: The join rules of the email (e.g. "public").
room_name: The m.room.name of the room.
room_type: The type of the room from its m.room.create event (e.g "m.space").
inviter_display_name: The current display name of the
inviter.
inviter_avatar_url: The URL of the inviter's avatar.
Expand All @@ -868,6 +870,7 @@ async def ask_id_server_for_third_party_invite(
"sender": inviter_user_id,
"sender_display_name": inviter_display_name,
"sender_avatar_url": inviter_avatar_url,
"org.matrix.mscxxxx.room_type": room_type, # MSCXXXX
}
# If a custom web client location is available, include it in the request.
if self._web_client_location:
Expand Down
6 changes: 6 additions & 0 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,11 @@ async def _make_and_store_3pid_invite(
if room_name_event:
room_name = room_name_event.content.get("name", "")

room_type = ""
room_create_event = room_state.get((EventTypes.Create, ""))
if room_create_event:
room_type = room_create_event.content.get("type", "")
t3chguy marked this conversation as resolved.
Show resolved Hide resolved

room_join_rules = ""
join_rules_event = room_state.get((EventTypes.JoinRules, ""))
if join_rules_event:
Expand All @@ -1164,6 +1169,7 @@ async def _make_and_store_3pid_invite(
room_avatar_url=room_avatar_url,
room_join_rules=room_join_rules,
room_name=room_name,
room_type=room_type,
inviter_display_name=inviter_display_name,
inviter_avatar_url=inviter_avatar_url,
id_access_token=id_access_token,
Expand Down