mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-26 00:01: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{}{},
|
Content: map[string]interface{}{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if any ?server_name= query parameters were
|
// Check to see if any ?via= or ?server_name= query parameters
|
||||||
// given in the request.
|
// were given in the request.
|
||||||
if serverNames, ok := req.URL.Query()["server_name"]; ok {
|
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 {
|
for _, serverName := range serverNames {
|
||||||
joinReq.ServerNames = append(
|
joinReq.ServerNames = append(
|
||||||
joinReq.ServerNames,
|
joinReq.ServerNames,
|
||||||
|
|
Loading…
Reference in a new issue