diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-08-26 18:23:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 18:23:08 +0100 |
commit | 42183bef508be3495ac429abf29b795f9c8d2a6e (patch) | |
tree | e2ed8e08bcfdd3addc98379fa1239bd425cf4544 | |
parent | 3802efe3011cde7df7b10cf5e8b6763d518e1089 (diff) |
Allow join to accept server_name in query parameters (#1346)
-rw-r--r-- | clientapi/routing/joinroom.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clientapi/routing/joinroom.go b/clientapi/routing/joinroom.go index cb68fe19..6e159b2a 100644 --- a/clientapi/routing/joinroom.go +++ b/clientapi/routing/joinroom.go @@ -41,6 +41,17 @@ func JoinRoomByIDOrAlias( } joinRes := roomserverAPI.PerformJoinResponse{} + // Check to see if any ?server_name= query parameters were + // given in the request. + if serverNames, ok := req.URL.Query()["server_name"]; ok { + for _, serverName := range serverNames { + joinReq.ServerNames = append( + joinReq.ServerNames, + gomatrixserverlib.ServerName(serverName), + ) + } + } + // If content was provided in the request then incude that // in the request. It'll get used as a part of the membership // event content. |