mirror of
https://github.com/element-hq/dendrite.git
synced 2025-03-14 14:15:35 +00:00
Add via parameter on join room requests as per MSC4156 (#3441)
This implements [MSC4156](https://github.com/matrix-org/matrix-spec-proposals/pull/4156) which will ship with Matrix 1.12 and is the continuation of https://github.com/matrix-org/dendrite/pull/3438. ### Pull Request Checklist <!-- Please read https://matrix-org.github.io/dendrite/development/contributing before submitting your pull request --> * [ ] I have added Go unit tests or [Complement integration tests](https://github.com/matrix-org/complement) for this PR _or_ I have justified why this PR doesn't need tests * [x] Pull request includes a [sign off below using a legally identifiable name](https://matrix-org.github.io/dendrite/development/contributing#sign-off) _or_ I have already signed off privately Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org> Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org> Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
This commit is contained in:
parent
7cc7ebb46f
commit
7acf32f24d
1 changed files with 10 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue