Try sending supported room versions as part of make_join

This commit is contained in:
Neil Alexander 2020-02-20 13:41:18 +00:00
parent b5900e8d3a
commit 3383d312f5
3 changed files with 9 additions and 2 deletions

View file

@ -28,6 +28,7 @@ import (
"github.com/matrix-org/dendrite/common"
"github.com/matrix-org/dendrite/common/config"
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/roomserver/version"
"github.com/matrix-org/gomatrix"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/util"
@ -288,7 +289,11 @@ func (r joinRoomReq) joinRoomUsingServers(
// server was invalid this returns an error.
// Otherwise this returns a JSONResponse.
func (r joinRoomReq) joinRoomUsingServer(roomID string, server gomatrixserverlib.ServerName) (*util.JSONResponse, error) {
respMakeJoin, err := r.federation.MakeJoin(r.req.Context(), server, roomID, r.userID)
var roomVersions []int
for i := range version.GetSupportedRoomVersions() {
roomVersions = append(roomVersions, int(i))
}
respMakeJoin, err := r.federation.MakeJoin(r.req.Context(), server, roomID, r.userID, roomVersions)
if err != nil {
// TODO: Check if the user was not allowed to join the room.
return nil, err

2
go.mod
View file

@ -14,7 +14,7 @@ require (
github.com/lib/pq v1.2.0
github.com/matrix-org/dugong v0.0.0-20171220115018-ea0a4690a0d5
github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26
github.com/matrix-org/gomatrixserverlib v0.0.0-20200220111558-3d684b2c03ab
github.com/matrix-org/gomatrixserverlib v0.0.0-20200220133731-65bb85dd5c75
github.com/matrix-org/naffka v0.0.0-20200127221512-0716baaabaf1
github.com/matrix-org/util v0.0.0-20171127121716-2e2df66af2f5
github.com/mattn/go-sqlite3 v2.0.2+incompatible

2
go.sum
View file

@ -73,6 +73,8 @@ github.com/matrix-org/gomatrixserverlib v0.0.0-20200124100636-0c2ec91d1df5 h1:km
github.com/matrix-org/gomatrixserverlib v0.0.0-20200124100636-0c2ec91d1df5/go.mod h1:FsKa2pWE/bpQql9H7U4boOPXFoJX/QcqaZZ6ijLkaZI=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200220111558-3d684b2c03ab h1:OSBUQmTJOwqsNhaPahRjT7QidbD42RVQYBZzgWyVsZA=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200220111558-3d684b2c03ab/go.mod h1:FsKa2pWE/bpQql9H7U4boOPXFoJX/QcqaZZ6ijLkaZI=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200220133731-65bb85dd5c75 h1:76ZTEwVfUqvFE9wWRbR37hj2CLVjDD/+VGuH1NEGsz8=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200220133731-65bb85dd5c75/go.mod h1:FsKa2pWE/bpQql9H7U4boOPXFoJX/QcqaZZ6ijLkaZI=
github.com/matrix-org/naffka v0.0.0-20200127221512-0716baaabaf1 h1:osLoFdOy+ChQqVUn2PeTDETFftVkl4w9t/OW18g3lnk=
github.com/matrix-org/naffka v0.0.0-20200127221512-0716baaabaf1/go.mod h1:cXoYQIENbdWIQHt1SyCo6Bl3C3raHwJ0wgVrXHSqf+A=
github.com/matrix-org/util v0.0.0-20171127121716-2e2df66af2f5 h1:W7l5CP4V7wPyPb4tYE11dbmeAOwtFQBTW0rf4OonOS8=