diff --git a/federationapi/api/api.go b/federationapi/api/api.go index 40b1abcb2..5b49e509e 100644 --- a/federationapi/api/api.go +++ b/federationapi/api/api.go @@ -157,9 +157,8 @@ type PerformDirectoryLookupResponse struct { } type PerformJoinRequest struct { - RoomID string `json:"room_id"` - UserID string `json:"user_id"` - SenderID spec.SenderID + RoomID string `json:"room_id"` + UserID string `json:"user_id"` // The sorted list of servers to try. Servers will be tried sequentially, after de-duplication. ServerNames types.ServerNames `json:"server_names"` Content map[string]interface{} `json:"content"` diff --git a/federationapi/federationapi_test.go b/federationapi/federationapi_test.go index 1e6170fa5..5d167c0ee 100644 --- a/federationapi/federationapi_test.go +++ b/federationapi/federationapi_test.go @@ -235,7 +235,6 @@ func testFederationAPIJoinThenKeyUpdate(t *testing.T, dbType test.DBType) { fsapi.PerformJoin(context.Background(), &api.PerformJoinRequest{ RoomID: room.ID, UserID: joiningUser.ID, - SenderID: spec.SenderID(joiningUser.ID), ServerNames: []spec.ServerName{serverA}, }, &resp) if resp.JoinedVia != serverA { diff --git a/federationapi/internal/perform.go b/federationapi/internal/perform.go index 50429f0d6..8e111c77d 100644 --- a/federationapi/internal/perform.go +++ b/federationapi/internal/perform.go @@ -96,7 +96,6 @@ func (r *FederationInternalAPI) PerformJoin( ctx, request.RoomID, request.UserID, - request.SenderID, request.Content, serverName, request.Unsigned, @@ -138,7 +137,7 @@ func (r *FederationInternalAPI) PerformJoin( func (r *FederationInternalAPI) performJoinUsingServer( ctx context.Context, - roomID, userID string, senderID spec.SenderID, + roomID, userID string, content map[string]interface{}, serverName spec.ServerName, unsigned map[string]interface{}, @@ -158,7 +157,6 @@ func (r *FederationInternalAPI) performJoinUsingServer( joinInput := gomatrixserverlib.PerformJoinInput{ UserID: user, - SenderID: senderID, RoomID: room, ServerName: serverName, Content: content, diff --git a/go.mod b/go.mod index c2cac9e90..fbe8f4329 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,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-20220926102614-ceba4d9f7530 - github.com/matrix-org/gomatrixserverlib v0.0.0-20230614105257-ddcf62d19d7e + github.com/matrix-org/gomatrixserverlib v0.0.0-20230614131217-2d6e6fab7500 github.com/matrix-org/pinecone v0.11.1-0.20230210171230-8c3b24f2649a github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 github.com/mattn/go-sqlite3 v1.14.16 diff --git a/go.sum b/go.sum index 68fb00634..7085dca75 100644 --- a/go.sum +++ b/go.sum @@ -323,8 +323,8 @@ github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91 h1:s7fexw github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91/go.mod h1:e+cg2q7C7yE5QnAXgzo512tgFh1RbQLC0+jozuegKgo= github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 h1:kHKxCOLcHH8r4Fzarl4+Y3K5hjothkVW5z7T1dUM11U= github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s= -github.com/matrix-org/gomatrixserverlib v0.0.0-20230614105257-ddcf62d19d7e h1:oxhV2yDP21/PddckGoA9paBZAN/bceccYXexcSi0EBg= -github.com/matrix-org/gomatrixserverlib v0.0.0-20230614105257-ddcf62d19d7e/go.mod h1:H9V9N3Uqn1bBJqYJNGK1noqtgJTaCEhtTdcH/mp50uU= +github.com/matrix-org/gomatrixserverlib v0.0.0-20230614131217-2d6e6fab7500 h1:/HrUyJl02nguDKl5VDpOpwkWuDHt3L+dc4TQNWFCr0E= +github.com/matrix-org/gomatrixserverlib v0.0.0-20230614131217-2d6e6fab7500/go.mod h1:H9V9N3Uqn1bBJqYJNGK1noqtgJTaCEhtTdcH/mp50uU= github.com/matrix-org/pinecone v0.11.1-0.20230210171230-8c3b24f2649a h1:awrPDf9LEFySxTLKYBMCiObelNx/cBuv/wzllvCCH3A= github.com/matrix-org/pinecone v0.11.1-0.20230210171230-8c3b24f2649a/go.mod h1:HchJX9oKMXaT2xYFs0Ha/6Zs06mxLU8k6F1ODnrGkeQ= github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 h1:6z4KxomXSIGWqhHcfzExgkH3Z3UkIXry4ibJS4Aqz2Y= diff --git a/roomserver/internal/perform/perform_join.go b/roomserver/internal/perform/perform_join.go index 7679f8711..5867ee6e0 100644 --- a/roomserver/internal/perform/perform_join.go +++ b/roomserver/internal/perform/perform_join.go @@ -272,7 +272,7 @@ func (r *Joiner) performJoinRoomByID( var joinedVia spec.ServerName if forceFederatedJoin { // TODO : pseudoIDs - pass through userID here since we don't know what the senderID should be yet - joinedVia, err = r.performFederatedJoinRoomByID(ctx, req, senderID) + joinedVia, err = r.performFederatedJoinRoomByID(ctx, req) return req.RoomIDOrAlias, joinedVia, err } @@ -362,7 +362,7 @@ func (r *Joiner) performJoinRoomByID( } // Perform a federated room join. - joinedVia, err = r.performFederatedJoinRoomByID(ctx, req, senderID) + joinedVia, err = r.performFederatedJoinRoomByID(ctx, req) return req.RoomIDOrAlias, joinedVia, err default: @@ -380,16 +380,14 @@ func (r *Joiner) performJoinRoomByID( func (r *Joiner) performFederatedJoinRoomByID( ctx context.Context, req *rsAPI.PerformJoinRequest, - senderID spec.SenderID, ) (spec.ServerName, error) { // Try joining by all of the supplied server names. fedReq := fsAPI.PerformJoinRequest{ RoomID: req.RoomIDOrAlias, // the room ID to try and join UserID: req.UserID, // the user ID joining the room - SenderID: spec.SenderID(senderID), - ServerNames: req.ServerNames, // the server to try joining with - Content: req.Content, // the membership event content - Unsigned: req.Unsigned, // the unsigned event content, if any + ServerNames: req.ServerNames, // the server to try joining with + Content: req.Content, // the membership event content + Unsigned: req.Unsigned, // the unsigned event content, if any } fedRes := fsAPI.PerformJoinResponse{} r.FSAPI.PerformJoin(ctx, &fedReq, &fedRes)