This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 117
117
JsonMapping ,
118
118
Requester ,
119
119
RoomAlias ,
120
+ RoomID ,
120
121
StateMap ,
121
122
UserID ,
122
123
UserInfo ,
@@ -929,6 +930,7 @@ async def update_room_membership(
929
930
room_id : str ,
930
931
new_membership : str ,
931
932
content : Optional [JsonDict ] = None ,
933
+ is_remote_join : bool = False ,
932
934
) -> EventBase :
933
935
"""Updates the membership of a user to the given value.
934
936
@@ -946,6 +948,9 @@ async def update_room_membership(
946
948
https://spec.matrix.org/unstable/client-server-api/#mroommember for the
947
949
list of allowed values.
948
950
content: Additional values to include in the resulting event's content.
951
+ is_remote_join: Must be True if room_id refers to a remote room and
952
+ new_membership is "join" (i.e. a remote join is needed), otherwise must
953
+ be False.
949
954
950
955
Returns:
951
956
The newly created membership event.
@@ -999,11 +1004,16 @@ async def update_room_membership(
999
1004
if "displayname" not in content :
1000
1005
content ["displayname" ] = profile ["displayname" ]
1001
1006
1007
+ remote_room_hosts = None
1008
+ if is_remote_join :
1009
+ remote_room_hosts = [RoomID .from_string (room_id ).domain ]
1010
+
1002
1011
event_id , _ = await self ._hs .get_room_member_handler ().update_membership (
1003
1012
requester = requester ,
1004
1013
target = target_user_id ,
1005
1014
room_id = room_id ,
1006
1015
action = new_membership ,
1016
+ remote_room_hosts = remote_room_hosts ,
1007
1017
content = content ,
1008
1018
)
1009
1019
You can’t perform that action at this time.
0 commit comments