diff --git a/clientapi/routing/joinroom.go b/clientapi/routing/joinroom.go index 30cb3233..275d356a 100644 --- a/clientapi/routing/joinroom.go +++ b/clientapi/routing/joinroom.go @@ -36,9 +36,16 @@ func JoinRoomByIDOrAlias( Content: map[string]interface{}{}, } - // Check to see if any ?server_name= query parameters were - // given in the request. - if serverNames, ok := req.URL.Query()["server_name"]; ok { + // Check to see if any ?via= or ?server_name= query parameters + // were given in the request. + if serverNames, ok := req.URL.Query()["via"]; ok { + for _, serverName := range serverNames { + joinReq.ServerNames = append( + joinReq.ServerNames, + spec.ServerName(serverName), + ) + } + } else if serverNames, ok := req.URL.Query()["server_name"]; ok { for _, serverName := range serverNames { joinReq.ServerNames = append( joinReq.ServerNames,