From b541f3043f0ad8924547c540d9235d017d1792f6 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 26 May 2022 15:08:17 +0100 Subject: [PATCH] Add support for MSC3787 and `org.matrix.msc3787` room version (update to matrix-org/gomatrixserverlib#310) --- federationapi/routing/join.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- roomserver/internal/query/query.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index abf9c094..8d779c3d 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -425,7 +425,7 @@ func checkRestrictedJoin( roomVersion gomatrixserverlib.RoomVersion, roomID, userID string, ) (*util.JSONResponse, string, error) { - if allowRestricted, err := roomVersion.AllowRestrictedJoinsInEventAuth(); err != nil { + if allowRestricted, err := roomVersion.MayAllowRestrictedJoinsInEventAuth(); err != nil { return nil, "", err } else if !allowRestricted { return nil, "", nil diff --git a/go.mod b/go.mod index 5b732ab4..9bb2b08e 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/matrix-org/dugong v0.0.0-20210921133753-66e6b1c67e2e github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91 github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 - github.com/matrix-org/gomatrixserverlib v0.0.0-20220526105206-b1c5619fe0c2 + github.com/matrix-org/gomatrixserverlib v0.0.0-20220526140030-dcfbb70ff32d github.com/matrix-org/pinecone v0.0.0-20220408153826-2999ea29ed48 github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 github.com/mattn/go-sqlite3 v1.14.13 diff --git a/go.sum b/go.sum index 48fd5061..0aae9b00 100644 --- a/go.sum +++ b/go.sum @@ -418,8 +418,8 @@ github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91/go.mod h1 github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26/go.mod h1:3fxX6gUjWyI/2Bt7J1OLhpCzOfO/bB3AiX0cJtEKud0= github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 h1:ZtO5uywdd5dLDCud4r0r55eP4j9FuUNpl60Gmntcop4= github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s= -github.com/matrix-org/gomatrixserverlib v0.0.0-20220526105206-b1c5619fe0c2 h1:t5VdznF0DiPayir4lTWvdHuk2+rDlwe3qksrgua+f3Q= -github.com/matrix-org/gomatrixserverlib v0.0.0-20220526105206-b1c5619fe0c2/go.mod h1:jX38yp3SSLJNftBg3PXU1ayd0PCLIiDHQ4xAc9DIixk= +github.com/matrix-org/gomatrixserverlib v0.0.0-20220526140030-dcfbb70ff32d h1:IwyG/58rFn0/ugD0A/IdSIo7D/oLJ4+k3NznlYhzyHs= +github.com/matrix-org/gomatrixserverlib v0.0.0-20220526140030-dcfbb70ff32d/go.mod h1:jX38yp3SSLJNftBg3PXU1ayd0PCLIiDHQ4xAc9DIixk= github.com/matrix-org/pinecone v0.0.0-20220408153826-2999ea29ed48 h1:W0sjjC6yjskHX4mb0nk3p0fXAlbU5bAFUFeEtlrPASE= github.com/matrix-org/pinecone v0.0.0-20220408153826-2999ea29ed48/go.mod h1:ulJzsVOTssIVp1j/m5eI//4VpAGDkMt5NrRuAVX7wpc= github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= diff --git a/roomserver/internal/query/query.go b/roomserver/internal/query/query.go index 70613baa..6d306fb0 100644 --- a/roomserver/internal/query/query.go +++ b/roomserver/internal/query/query.go @@ -772,7 +772,7 @@ func (r *Queryer) QueryRestrictedJoinAllowed(ctx context.Context, req *api.Query } // If the room version doesn't allow restricted joins then don't // try to process any further. - allowRestrictedJoins, err := roomInfo.RoomVersion.AllowRestrictedJoinsInEventAuth() + allowRestrictedJoins, err := roomInfo.RoomVersion.MayAllowRestrictedJoinsInEventAuth() if err != nil { return fmt.Errorf("roomInfo.RoomVersion.AllowRestrictedJoinsInEventAuth: %w", err) } else if !allowRestrictedJoins {