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

Method processDeviceListUpdate

federationapi/routing/send.go:491–507  ·  view source on GitHub ↗
(ctx context.Context, e gomatrixserverlib.EDU)

Source from the content-addressed store, hash-verified

489}
490
491func (t *txnReq) processDeviceListUpdate(ctx context.Context, e gomatrixserverlib.EDU) {
492 var payload gomatrixserverlib.DeviceListUpdateEvent
493 if err := json.Unmarshal(e.Content, &payload); err != nil {
494 util.GetLogger(ctx).WithError(err).Error("Failed to unmarshal device list update event")
495 return
496 }
497 if _, serverName, err := gomatrixserverlib.SplitID('@', payload.UserID); err != nil {
498 return
499 } else if serverName == t.ourServerName {
500 return
501 } else if serverName != t.Origin {
502 return
503 }
504 if err := t.producer.SendDeviceListUpdate(ctx, &payload); err != nil {
505 util.GetLogger(ctx).WithError(err).WithField("user_id", payload.UserID).Error("failed to InputDeviceListUpdate")
506 }
507}

Callers 1

processEDUsMethod · 0.95

Calls 2

SendDeviceListUpdateMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected