diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2022-07-12 08:23:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 08:23:58 +0200 |
commit | 09f0ff14c88fec2ae5b3db79054378a8ced255a9 (patch) | |
tree | f433d00d3320c32ffb91ec695748a9afefbe4604 /federationapi | |
parent | 3ea21273bcc151b36eec412d0ec550642fe9b04f (diff) |
Minor SendToDevice fix (#2565)
* Avoid unnecessary marshalling if sending to the local server
* Fix ordering of ToDevice messages
* Revive SendToDevice test
Diffstat (limited to 'federationapi')
-rw-r--r-- | federationapi/consumers/sendtodevice.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/federationapi/consumers/sendtodevice.go b/federationapi/consumers/sendtodevice.go index 84c9f620..f99a895e 100644 --- a/federationapi/consumers/sendtodevice.go +++ b/federationapi/consumers/sendtodevice.go @@ -95,6 +95,11 @@ func (t *OutputSendToDeviceConsumer) onMessage(ctx context.Context, msg *nats.Ms return true } + // The SyncAPI is already handling sendToDevice for the local server + if destServerName == t.ServerName { + return true + } + // Pack the EDU and marshal it edu := &gomatrixserverlib.EDU{ Type: gomatrixserverlib.MDirectToDevice, |