Join room support in federation sender (#989)

* Implement PerformJoinRequest

* Rename perform functions

* Check send join response

* Temporary wiring to test federation sender room joins

* Actually pass through the config

* Make sure membership content shows join
This commit is contained in:
Neil Alexander 2020-04-29 15:29:39 +01:00 committed by GitHub
parent a308e61331
commit 64e94e9a6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 265 additions and 135 deletions

View file

@ -25,13 +25,13 @@ type FederationSenderInternalAPI interface {
response *QueryJoinedHostServerNamesInRoomResponse,
) error
// Handle an instruction to make_join & send_join with a remote server.
PerformJoinRequest(
PerformJoin(
ctx context.Context,
request *PerformJoinRequest,
response *PerformJoinResponse,
) error
// Handle an instruction to make_leave & send_leave with a remote server.
PerformLeaveRequest(
PerformLeave(
ctx context.Context,
request *PerformLeaveRequest,
response *PerformLeaveResponse,

View file

@ -4,6 +4,7 @@ import (
"context"
commonHTTP "github.com/matrix-org/dendrite/common/http"
"github.com/matrix-org/gomatrixserverlib"
"github.com/opentracing/opentracing-go"
)
@ -16,14 +17,17 @@ const (
)
type PerformJoinRequest struct {
RoomID string `json:"room_id"`
RoomID string `json:"room_id"`
UserID string `json:"user_id"`
ServerName gomatrixserverlib.ServerName `json:"server_name"`
Content map[string]interface{} `json:"content"`
}
type PerformJoinResponse struct {
}
// Handle an instruction to make_join & send_join with a remote server.
func (h *httpFederationSenderInternalAPI) PerformJoinRequest(
func (h *httpFederationSenderInternalAPI) PerformJoin(
ctx context.Context,
request *PerformJoinRequest,
response *PerformJoinResponse,
@ -43,7 +47,7 @@ type PerformLeaveResponse struct {
}
// Handle an instruction to make_leave & send_leave with a remote server.
func (h *httpFederationSenderInternalAPI) PerformLeaveRequest(
func (h *httpFederationSenderInternalAPI) PerformLeave(
ctx context.Context,
request *PerformLeaveRequest,
response *PerformLeaveResponse,