mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-22 06:11:55 -06:00
Add via parameter on join room requests as per MSC4156
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
parent
6cd1285ca0
commit
0ec82fbeae
|
@ -44,9 +44,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,
|
||||
|
|
Loading…
Reference in a new issue