aboutsummaryrefslogtreecommitdiff
path: root/federationapi
diff options
context:
space:
mode:
Diffstat (limited to 'federationapi')
-rw-r--r--federationapi/api/api.go62
-rw-r--r--federationapi/federationapi.go2
-rw-r--r--federationapi/routing/backfill.go2
-rw-r--r--federationapi/routing/eventauth.go2
-rw-r--r--federationapi/routing/events.go6
-rw-r--r--federationapi/routing/invite.go6
-rw-r--r--federationapi/routing/join.go4
-rw-r--r--federationapi/routing/leave.go4
-rw-r--r--federationapi/routing/missingevents.go2
-rw-r--r--federationapi/routing/openid.go2
-rw-r--r--federationapi/routing/peek.go2
-rw-r--r--federationapi/routing/profile.go2
-rw-r--r--federationapi/routing/publicrooms.go6
-rw-r--r--federationapi/routing/query.go2
-rw-r--r--federationapi/routing/routing.go6
-rw-r--r--federationapi/routing/send.go4
-rw-r--r--federationapi/routing/send_test.go2
-rw-r--r--federationapi/routing/state.go6
-rw-r--r--federationapi/routing/threepid.go12
19 files changed, 62 insertions, 72 deletions
diff --git a/federationapi/api/api.go b/federationapi/api/api.go
index ce6a0f2e..87b03718 100644
--- a/federationapi/api/api.go
+++ b/federationapi/api/api.go
@@ -14,17 +14,13 @@ import (
// implements as proxy calls, with built-in backoff/retries/etc. Errors returned from functions in
// this interface are of type FederationClientError
type FederationClient interface {
- gomatrixserverlib.BackfillClient
gomatrixserverlib.FederatedStateClient
GetUserDevices(ctx context.Context, s gomatrixserverlib.ServerName, userID string) (res gomatrixserverlib.RespUserDevices, err error)
ClaimKeys(ctx context.Context, s gomatrixserverlib.ServerName, oneTimeKeys map[string]map[string]string) (res gomatrixserverlib.RespClaimKeys, err error)
QueryKeys(ctx context.Context, s gomatrixserverlib.ServerName, keys map[string][]string) (res gomatrixserverlib.RespQueryKeys, err error)
- GetEvent(ctx context.Context, s gomatrixserverlib.ServerName, eventID string) (res gomatrixserverlib.Transaction, err error)
MSC2836EventRelationships(ctx context.Context, dst gomatrixserverlib.ServerName, r gomatrixserverlib.MSC2836EventRelationshipsRequest, roomVersion gomatrixserverlib.RoomVersion) (res gomatrixserverlib.MSC2836EventRelationshipsResponse, err error)
MSC2946Spaces(ctx context.Context, dst gomatrixserverlib.ServerName, roomID string, suggestedOnly bool) (res gomatrixserverlib.MSC2946SpacesResponse, err error)
LookupServerKeys(ctx context.Context, s gomatrixserverlib.ServerName, keyRequests map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.Timestamp) ([]gomatrixserverlib.ServerKeys, error)
- GetEventAuth(ctx context.Context, s gomatrixserverlib.ServerName, roomVersion gomatrixserverlib.RoomVersion, roomID, eventID string) (res gomatrixserverlib.RespEventAuth, err error)
- LookupMissingEvents(ctx context.Context, s gomatrixserverlib.ServerName, roomID string, missing gomatrixserverlib.MissingEvents, roomVersion gomatrixserverlib.RoomVersion) (res gomatrixserverlib.RespMissingEvents, err error)
}
// FederationClientError is returned from FederationClient methods in the event of a problem.
@@ -43,17 +39,10 @@ type FederationInternalAPI interface {
FederationClient
gomatrixserverlib.KeyDatabase
ClientFederationAPI
-
- KeyRing() *gomatrixserverlib.KeyRing
+ RoomserverFederationAPI
QueryServerKeys(ctx context.Context, request *QueryServerKeysRequest, response *QueryServerKeysResponse) error
- // PerformDirectoryLookup looks up a remote room ID from a room alias.
- PerformDirectoryLookup(
- ctx context.Context,
- request *PerformDirectoryLookupRequest,
- response *PerformDirectoryLookupResponse,
- ) error
// Query the server names of the joined hosts in a room.
// Unlike QueryJoinedHostsInRoom, this function returns a de-duplicated slice
// containing only the server names (without information for membership events).
@@ -63,30 +52,6 @@ type FederationInternalAPI interface {
request *QueryJoinedHostServerNamesInRoomRequest,
response *QueryJoinedHostServerNamesInRoomResponse,
) error
- // Handle an instruction to make_join & send_join with a remote server.
- PerformJoin(
- ctx context.Context,
- request *PerformJoinRequest,
- response *PerformJoinResponse,
- )
- // Handle an instruction to peek a room on a remote server.
- PerformOutboundPeek(
- ctx context.Context,
- request *PerformOutboundPeekRequest,
- response *PerformOutboundPeekResponse,
- ) error
- // Handle an instruction to make_leave & send_leave with a remote server.
- PerformLeave(
- ctx context.Context,
- request *PerformLeaveRequest,
- response *PerformLeaveResponse,
- ) error
- // Handle sending an invite to a remote server.
- PerformInvite(
- ctx context.Context,
- request *PerformInviteRequest,
- response *PerformInviteResponse,
- ) error
// Notifies the federation sender that these servers may be online and to retry sending messages.
PerformServersAlive(
ctx context.Context,
@@ -105,6 +70,31 @@ type ClientFederationAPI interface {
QueryJoinedHostServerNamesInRoom(ctx context.Context, request *QueryJoinedHostServerNamesInRoomRequest, response *QueryJoinedHostServerNamesInRoomResponse) error
}
+type RoomserverFederationAPI interface {
+ gomatrixserverlib.BackfillClient
+ gomatrixserverlib.FederatedStateClient
+ KeyRing() *gomatrixserverlib.KeyRing
+
+ // PerformDirectoryLookup looks up a remote room ID from a room alias.
+ PerformDirectoryLookup(ctx context.Context, request *PerformDirectoryLookupRequest, response *PerformDirectoryLookupResponse) error
+ // Handle an instruction to make_join & send_join with a remote server.
+ PerformJoin(ctx context.Context, request *PerformJoinRequest, response *PerformJoinResponse)
+ // Handle an instruction to make_leave & send_leave with a remote server.
+ PerformLeave(ctx context.Context, request *PerformLeaveRequest, response *PerformLeaveResponse) error
+ // Handle sending an invite to a remote server.
+ PerformInvite(ctx context.Context, request *PerformInviteRequest, response *PerformInviteResponse) error
+ // Handle an instruction to peek a room on a remote server.
+ PerformOutboundPeek(ctx context.Context, request *PerformOutboundPeekRequest, response *PerformOutboundPeekResponse) error
+ // Query the server names of the joined hosts in a room.
+ // Unlike QueryJoinedHostsInRoom, this function returns a de-duplicated slice
+ // containing only the server names (without information for membership events).
+ // The response will include this server if they are joined to the room.
+ QueryJoinedHostServerNamesInRoom(ctx context.Context, request *QueryJoinedHostServerNamesInRoomRequest, response *QueryJoinedHostServerNamesInRoomResponse) error
+ GetEventAuth(ctx context.Context, s gomatrixserverlib.ServerName, roomVersion gomatrixserverlib.RoomVersion, roomID, eventID string) (res gomatrixserverlib.RespEventAuth, err error)
+ GetEvent(ctx context.Context, s gomatrixserverlib.ServerName, eventID string) (res gomatrixserverlib.Transaction, err error)
+ LookupMissingEvents(ctx context.Context, s gomatrixserverlib.ServerName, roomID string, missing gomatrixserverlib.MissingEvents, roomVersion gomatrixserverlib.RoomVersion) (res gomatrixserverlib.RespMissingEvents, err error)
+}
+
type QueryServerKeysRequest struct {
ServerName gomatrixserverlib.ServerName
KeyIDToCriteria map[gomatrixserverlib.KeyID]gomatrixserverlib.PublicKeyNotaryQueryCriteria
diff --git a/federationapi/federationapi.go b/federationapi/federationapi.go
index c627aab5..632994db 100644
--- a/federationapi/federationapi.go
+++ b/federationapi/federationapi.go
@@ -49,7 +49,7 @@ func AddPublicRoutes(
userAPI userapi.UserInternalAPI,
federation *gomatrixserverlib.FederationClient,
keyRing gomatrixserverlib.JSONVerifier,
- rsAPI roomserverAPI.RoomserverInternalAPI,
+ rsAPI roomserverAPI.FederationRoomserverAPI,
federationAPI federationAPI.FederationInternalAPI,
keyAPI keyserverAPI.KeyInternalAPI,
servers federationAPI.ServersInRoomProvider,
diff --git a/federationapi/routing/backfill.go b/federationapi/routing/backfill.go
index 82f6cbab..7b9ca66f 100644
--- a/federationapi/routing/backfill.go
+++ b/federationapi/routing/backfill.go
@@ -33,7 +33,7 @@ import (
func Backfill(
httpReq *http.Request,
request *gomatrixserverlib.FederationRequest,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID string,
cfg *config.FederationAPI,
) util.JSONResponse {
diff --git a/federationapi/routing/eventauth.go b/federationapi/routing/eventauth.go
index e83cb8ad..868785a9 100644
--- a/federationapi/routing/eventauth.go
+++ b/federationapi/routing/eventauth.go
@@ -26,7 +26,7 @@ import (
func GetEventAuth(
ctx context.Context,
request *gomatrixserverlib.FederationRequest,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID string,
eventID string,
) util.JSONResponse {
diff --git a/federationapi/routing/events.go b/federationapi/routing/events.go
index 312ef9f8..23796edf 100644
--- a/federationapi/routing/events.go
+++ b/federationapi/routing/events.go
@@ -29,7 +29,7 @@ import (
func GetEvent(
ctx context.Context,
request *gomatrixserverlib.FederationRequest,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
eventID string,
origin gomatrixserverlib.ServerName,
) util.JSONResponse {
@@ -56,7 +56,7 @@ func GetEvent(
func allowedToSeeEvent(
ctx context.Context,
origin gomatrixserverlib.ServerName,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
eventID string,
) *util.JSONResponse {
var authResponse api.QueryServerAllowedToSeeEventResponse
@@ -82,7 +82,7 @@ func allowedToSeeEvent(
}
// fetchEvent fetches the event without auth checks. Returns an error if the event cannot be found.
-func fetchEvent(ctx context.Context, rsAPI api.RoomserverInternalAPI, eventID string) (*gomatrixserverlib.Event, *util.JSONResponse) {
+func fetchEvent(ctx context.Context, rsAPI api.FederationRoomserverAPI, eventID string) (*gomatrixserverlib.Event, *util.JSONResponse) {
var eventsResponse api.QueryEventsByIDResponse
err := rsAPI.QueryEventsByID(
ctx,
diff --git a/federationapi/routing/invite.go b/federationapi/routing/invite.go
index 25faff0c..a5797645 100644
--- a/federationapi/routing/invite.go
+++ b/federationapi/routing/invite.go
@@ -35,7 +35,7 @@ func InviteV2(
roomID string,
eventID string,
cfg *config.FederationAPI,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
keys gomatrixserverlib.JSONVerifier,
) util.JSONResponse {
inviteReq := gomatrixserverlib.InviteV2Request{}
@@ -72,7 +72,7 @@ func InviteV1(
roomID string,
eventID string,
cfg *config.FederationAPI,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
keys gomatrixserverlib.JSONVerifier,
) util.JSONResponse {
roomVer := gomatrixserverlib.RoomVersionV1
@@ -110,7 +110,7 @@ func processInvite(
roomID string,
eventID string,
cfg *config.FederationAPI,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
keys gomatrixserverlib.JSONVerifier,
) util.JSONResponse {
diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go
index 495b8c91..76769972 100644
--- a/federationapi/routing/join.go
+++ b/federationapi/routing/join.go
@@ -34,7 +34,7 @@ func MakeJoin(
httpReq *http.Request,
request *gomatrixserverlib.FederationRequest,
cfg *config.FederationAPI,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID, userID string,
remoteVersions []gomatrixserverlib.RoomVersion,
) util.JSONResponse {
@@ -165,7 +165,7 @@ func SendJoin(
httpReq *http.Request,
request *gomatrixserverlib.FederationRequest,
cfg *config.FederationAPI,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
keys gomatrixserverlib.JSONVerifier,
roomID, eventID string,
) util.JSONResponse {
diff --git a/federationapi/routing/leave.go b/federationapi/routing/leave.go
index 0b83f04a..54b2c3e8 100644
--- a/federationapi/routing/leave.go
+++ b/federationapi/routing/leave.go
@@ -30,7 +30,7 @@ func MakeLeave(
httpReq *http.Request,
request *gomatrixserverlib.FederationRequest,
cfg *config.FederationAPI,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID, userID string,
) util.JSONResponse {
_, domain, err := gomatrixserverlib.SplitID('@', userID)
@@ -122,7 +122,7 @@ func SendLeave(
httpReq *http.Request,
request *gomatrixserverlib.FederationRequest,
cfg *config.FederationAPI,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
keys gomatrixserverlib.JSONVerifier,
roomID, eventID string,
) util.JSONResponse {
diff --git a/federationapi/routing/missingevents.go b/federationapi/routing/missingevents.go
index b826d69c..531cb9e2 100644
--- a/federationapi/routing/missingevents.go
+++ b/federationapi/routing/missingevents.go
@@ -34,7 +34,7 @@ type getMissingEventRequest struct {
func GetMissingEvents(
httpReq *http.Request,
request *gomatrixserverlib.FederationRequest,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID string,
) util.JSONResponse {
var gme getMissingEventRequest
diff --git a/federationapi/routing/openid.go b/federationapi/routing/openid.go
index 829dbcca..cbc75a9a 100644
--- a/federationapi/routing/openid.go
+++ b/federationapi/routing/openid.go
@@ -30,7 +30,7 @@ type openIDUserInfoResponse struct {
// GetOpenIDUserInfo implements GET /_matrix/federation/v1/openid/userinfo
func GetOpenIDUserInfo(
httpReq *http.Request,
- userAPI userapi.UserInternalAPI,
+ userAPI userapi.FederationUserAPI,
) util.JSONResponse {
token := httpReq.URL.Query().Get("access_token")
if len(token) == 0 {
diff --git a/federationapi/routing/peek.go b/federationapi/routing/peek.go
index 827d1116..bc4dac90 100644
--- a/federationapi/routing/peek.go
+++ b/federationapi/routing/peek.go
@@ -29,7 +29,7 @@ func Peek(
httpReq *http.Request,
request *gomatrixserverlib.FederationRequest,
cfg *config.FederationAPI,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID, peekID string,
remoteVersions []gomatrixserverlib.RoomVersion,
) util.JSONResponse {
diff --git a/federationapi/routing/profile.go b/federationapi/routing/profile.go
index dbc209ce..f672811a 100644
--- a/federationapi/routing/profile.go
+++ b/federationapi/routing/profile.go
@@ -29,7 +29,7 @@ import (
// GetProfile implements GET /_matrix/federation/v1/query/profile
func GetProfile(
httpReq *http.Request,
- userAPI userapi.UserInternalAPI,
+ userAPI userapi.FederationUserAPI,
cfg *config.FederationAPI,
) util.JSONResponse {
userID, field := httpReq.FormValue("user_id"), httpReq.FormValue("field")
diff --git a/federationapi/routing/publicrooms.go b/federationapi/routing/publicrooms.go
index a253f86e..1a54f5a7 100644
--- a/federationapi/routing/publicrooms.go
+++ b/federationapi/routing/publicrooms.go
@@ -23,7 +23,7 @@ type filter struct {
}
// GetPostPublicRooms implements GET and POST /publicRooms
-func GetPostPublicRooms(req *http.Request, rsAPI roomserverAPI.RoomserverInternalAPI) util.JSONResponse {
+func GetPostPublicRooms(req *http.Request, rsAPI roomserverAPI.FederationRoomserverAPI) util.JSONResponse {
var request PublicRoomReq
if fillErr := fillPublicRoomsReq(req, &request); fillErr != nil {
return *fillErr
@@ -42,7 +42,7 @@ func GetPostPublicRooms(req *http.Request, rsAPI roomserverAPI.RoomserverInterna
}
func publicRooms(
- ctx context.Context, request PublicRoomReq, rsAPI roomserverAPI.RoomserverInternalAPI,
+ ctx context.Context, request PublicRoomReq, rsAPI roomserverAPI.FederationRoomserverAPI,
) (*gomatrixserverlib.RespPublicRooms, error) {
var response gomatrixserverlib.RespPublicRooms
@@ -111,7 +111,7 @@ func fillPublicRoomsReq(httpReq *http.Request, request *PublicRoomReq) *util.JSO
}
// due to lots of switches
-func fillInRooms(ctx context.Context, roomIDs []string, rsAPI roomserverAPI.RoomserverInternalAPI) ([]gomatrixserverlib.PublicRoom, error) {
+func fillInRooms(ctx context.Context, roomIDs []string, rsAPI roomserverAPI.FederationRoomserverAPI) ([]gomatrixserverlib.PublicRoom, error) {
avatarTuple := gomatrixserverlib.StateKeyTuple{EventType: "m.room.avatar", StateKey: ""}
nameTuple := gomatrixserverlib.StateKeyTuple{EventType: "m.room.name", StateKey: ""}
canonicalTuple := gomatrixserverlib.StateKeyTuple{EventType: gomatrixserverlib.MRoomCanonicalAlias, StateKey: ""}
diff --git a/federationapi/routing/query.go b/federationapi/routing/query.go
index 47d3b2df..707b7b01 100644
--- a/federationapi/routing/query.go
+++ b/federationapi/routing/query.go
@@ -32,7 +32,7 @@ func RoomAliasToID(
httpReq *http.Request,
federation *gomatrixserverlib.FederationClient,
cfg *config.FederationAPI,
- rsAPI roomserverAPI.RoomserverInternalAPI,
+ rsAPI roomserverAPI.FederationRoomserverAPI,
senderAPI federationAPI.FederationInternalAPI,
) util.JSONResponse {
roomAlias := httpReq.FormValue("room_alias")
diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go
index 6d24c8b4..51adc279 100644
--- a/federationapi/routing/routing.go
+++ b/federationapi/routing/routing.go
@@ -47,11 +47,11 @@ import (
func Setup(
fedMux, keyMux, wkMux *mux.Router,
cfg *config.FederationAPI,
- rsAPI roomserverAPI.RoomserverInternalAPI,
+ rsAPI roomserverAPI.FederationRoomserverAPI,
fsAPI federationAPI.FederationInternalAPI,
keys gomatrixserverlib.JSONVerifier,
federation *gomatrixserverlib.FederationClient,
- userAPI userapi.UserInternalAPI,
+ userAPI userapi.FederationUserAPI,
keyAPI keyserverAPI.KeyInternalAPI,
mscCfg *config.MSCs,
servers federationAPI.ServersInRoomProvider,
@@ -497,7 +497,7 @@ func Setup(
func ErrorIfLocalServerNotInRoom(
ctx context.Context,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID string,
) *util.JSONResponse {
// Check if we think we're in this room. If we aren't then
diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go
index 2c01afb1..b9b6d33b 100644
--- a/federationapi/routing/send.go
+++ b/federationapi/routing/send.go
@@ -82,7 +82,7 @@ func Send(
request *gomatrixserverlib.FederationRequest,
txnID gomatrixserverlib.TransactionID,
cfg *config.FederationAPI,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
keyAPI keyapi.KeyInternalAPI,
keys gomatrixserverlib.JSONVerifier,
federation *gomatrixserverlib.FederationClient,
@@ -182,7 +182,7 @@ func Send(
type txnReq struct {
gomatrixserverlib.Transaction
- rsAPI api.RoomserverInternalAPI
+ rsAPI api.FederationRoomserverAPI
keyAPI keyapi.KeyInternalAPI
ourServerName gomatrixserverlib.ServerName
keys gomatrixserverlib.JSONVerifier
diff --git a/federationapi/routing/send_test.go b/federationapi/routing/send_test.go
index 8d2d8504..011d4e34 100644
--- a/federationapi/routing/send_test.go
+++ b/federationapi/routing/send_test.go
@@ -183,7 +183,7 @@ func (c *txnFedClient) LookupMissingEvents(ctx context.Context, s gomatrixserver
return c.getMissingEvents(missing)
}
-func mustCreateTransaction(rsAPI api.RoomserverInternalAPI, fedClient txnFederationClient, pdus []json.RawMessage) *txnReq {
+func mustCreateTransaction(rsAPI api.FederationRoomserverAPI, fedClient txnFederationClient, pdus []json.RawMessage) *txnReq {
t := &txnReq{
rsAPI: rsAPI,
keys: &test.NopJSONVerifier{},
diff --git a/federationapi/routing/state.go b/federationapi/routing/state.go
index e2b67776..6fdce20c 100644
--- a/federationapi/routing/state.go
+++ b/federationapi/routing/state.go
@@ -27,7 +27,7 @@ import (
func GetState(
ctx context.Context,
request *gomatrixserverlib.FederationRequest,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID string,
) util.JSONResponse {
eventID, err := parseEventIDParam(request)
@@ -50,7 +50,7 @@ func GetState(
func GetStateIDs(
ctx context.Context,
request *gomatrixserverlib.FederationRequest,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID string,
) util.JSONResponse {
eventID, err := parseEventIDParam(request)
@@ -97,7 +97,7 @@ func parseEventIDParam(
func getState(
ctx context.Context,
request *gomatrixserverlib.FederationRequest,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
roomID string,
eventID string,
) (stateEvents, authEvents []*gomatrixserverlib.HeaderedEvent, errRes *util.JSONResponse) {
diff --git a/federationapi/routing/threepid.go b/federationapi/routing/threepid.go
index 8ae7130c..16f245ce 100644
--- a/federationapi/routing/threepid.go
+++ b/federationapi/routing/threepid.go
@@ -55,10 +55,10 @@ var (
// CreateInvitesFrom3PIDInvites implements POST /_matrix/federation/v1/3pid/onbind
func CreateInvitesFrom3PIDInvites(
- req *http.Request, rsAPI api.RoomserverInternalAPI,
+ req *http.Request, rsAPI api.FederationRoomserverAPI,
cfg *config.FederationAPI,
federation *gomatrixserverlib.FederationClient,
- userAPI userapi.UserInternalAPI,
+ userAPI userapi.FederationUserAPI,
) util.JSONResponse {
var body invites
if reqErr := httputil.UnmarshalJSONRequest(req, &body); reqErr != nil {
@@ -105,7 +105,7 @@ func ExchangeThirdPartyInvite(
httpReq *http.Request,
request *gomatrixserverlib.FederationRequest,
roomID string,
- rsAPI api.RoomserverInternalAPI,
+ rsAPI api.FederationRoomserverAPI,
cfg *config.FederationAPI,
federation *gomatrixserverlib.FederationClient,
) util.JSONResponse {
@@ -203,10 +203,10 @@ func ExchangeThirdPartyInvite(
// Returns an error if there was a problem building the event or fetching the
// necessary data to do so.
func createInviteFrom3PIDInvite(
- ctx context.Context, rsAPI api.RoomserverInternalAPI,
+ ctx context.Context, rsAPI api.FederationRoomserverAPI,
cfg *config.FederationAPI,
inv invite, federation *gomatrixserverlib.FederationClient,
- userAPI userapi.UserInternalAPI,
+ userAPI userapi.FederationUserAPI,
) (*gomatrixserverlib.Event, error) {
verReq := api.QueryRoomVersionForRoomRequest{RoomID: inv.RoomID}
verRes := api.QueryRoomVersionForRoomResponse{}
@@ -270,7 +270,7 @@ func createInviteFrom3PIDInvite(
// Returns an error if something failed during the process.
func buildMembershipEvent(
ctx context.Context,
- builder *gomatrixserverlib.EventBuilder, rsAPI api.RoomserverInternalAPI,
+ builder *gomatrixserverlib.EventBuilder, rsAPI api.FederationRoomserverAPI,
cfg *config.FederationAPI,
) (*gomatrixserverlib.Event, error) {
eventsNeeded, err := gomatrixserverlib.StateNeededForEventBuilder(builder)