Skip to content

Commit

Permalink
Add via parameter on join room requests as per MSC4156
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Marbach <[email protected]>
  • Loading branch information
Johennes authored and neilalexander committed Oct 29, 2024
1 parent 8273774 commit 9ee5462
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions clientapi/routing/joinroom.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,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,
Expand Down

0 comments on commit 9ee5462

Please sign in to comment.