MCPcopy Create free account
hub / github.com/daodst/chat / SendDeviceListUpdate

Method SendDeviceListUpdate

federationapi/producers/syncapi.go:167–180  ·  view source on GitHub ↗
(
	ctx context.Context, deviceListUpdate *gomatrixserverlib.DeviceListUpdateEvent,
)

Source from the content-addressed store, hash-verified

165}
166
167func (p *SyncAPIProducer) SendDeviceListUpdate(
168 ctx context.Context, deviceListUpdate *gomatrixserverlib.DeviceListUpdateEvent,
169) (err error) {
170 m := nats.NewMsg(p.TopicDeviceListUpdate)
171 m.Header.Set(jetstream.UserID, deviceListUpdate.UserID)
172 m.Data, err = json.Marshal(deviceListUpdate)
173 if err != nil {
174 return fmt.Errorf("json.Marshal: %w", err)
175 }
176
177 log.Debugf("Sending device list update: %+v", m.Header)
178 _, err = p.JetStream.PublishMsg(m, nats.Context(ctx))
179 return err
180}

Callers 1

Calls 3

PublishMsgMethod · 0.80
ContextMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected