mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Add support for broadcasting wake-up EDUs to known hosts
This commit is contained in:
parent
8a5c2020b3
commit
b0a3ee6c5c
10 changed files with 142 additions and 7 deletions
|
@ -308,3 +308,25 @@ func (r *FederationSenderInternalAPI) PerformServersAlive(
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
// PerformServersAlive implements api.FederationSenderInternalAPI
|
||||
func (r *FederationSenderInternalAPI) PerformBroadcastEDU(
|
||||
ctx context.Context,
|
||||
request *api.PerformBroadcastEDURequest,
|
||||
response *api.PerformBroadcastEDUResponse,
|
||||
) (err error) {
|
||||
destinations, err := r.db.GetAllJoinedHosts(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("r.db.GetAllJoinedHosts: %w", err)
|
||||
}
|
||||
|
||||
edu := &gomatrixserverlib.EDU{
|
||||
Type: "org.matrix.dendrite.wakeup",
|
||||
Origin: string(r.cfg.Matrix.ServerName),
|
||||
}
|
||||
if err = r.queues.SendEDU(edu, r.cfg.Matrix.ServerName, destinations); err != nil {
|
||||
return fmt.Errorf("r.queues.SendEDU: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue