aboutsummaryrefslogtreecommitdiff
path: root/federationsender/inthttp/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'federationsender/inthttp/client.go')
-rw-r--r--federationsender/inthttp/client.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/federationsender/inthttp/client.go b/federationsender/inthttp/client.go
index 25de99cc..4d968919 100644
--- a/federationsender/inthttp/client.go
+++ b/federationsender/inthttp/client.go
@@ -19,6 +19,7 @@ const (
FederationSenderPerformJoinRequestPath = "/federationsender/performJoinRequest"
FederationSenderPerformLeaveRequestPath = "/federationsender/performLeaveRequest"
FederationSenderPerformServersAlivePath = "/federationsender/performServersAlive"
+ FederationSenderPerformBroadcastEDUPath = "/federationsender/performBroadcastEDU"
)
// NewFederationSenderClient creates a FederationSenderInternalAPI implemented by talking to a HTTP POST API.
@@ -105,3 +106,16 @@ func (h *httpFederationSenderInternalAPI) PerformDirectoryLookup(
apiURL := h.federationSenderURL + FederationSenderPerformDirectoryLookupRequestPath
return httputil.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
}
+
+// Handle an instruction to broadcast an EDU to all servers in rooms we are joined to.
+func (h *httpFederationSenderInternalAPI) PerformBroadcastEDU(
+ ctx context.Context,
+ request *api.PerformBroadcastEDURequest,
+ response *api.PerformBroadcastEDUResponse,
+) error {
+ span, ctx := opentracing.StartSpanFromContext(ctx, "PerformBroadcastEDU")
+ defer span.Finish()
+
+ apiURL := h.federationSenderURL + FederationSenderPerformBroadcastEDUPath
+ return httputil.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
+}