Avoid unnecessary marshalling if sending to the local server

This commit is contained in:
Till Faelligen 2022-07-11 16:43:16 +02:00
parent 3ea21273bc
commit a01cbb8600

View file

@ -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,