mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
Linting
This commit is contained in:
parent
617862e40c
commit
2a0c160148
|
|
@ -313,10 +313,18 @@ func (t *txnReq) processEDUs(edus []gomatrixserverlib.EDU) {
|
|||
}
|
||||
}
|
||||
case gomatrixserverlib.MDeviceListUpdate:
|
||||
t.processDeviceListUpdate(e)
|
||||
default:
|
||||
util.GetLogger(t.context).WithField("type", e.Type).Warn("unhandled edu")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *txnReq) processDeviceListUpdate(e gomatrixserverlib.EDU) {
|
||||
var payload gomatrixserverlib.DeviceListUpdateEvent
|
||||
if err := json.Unmarshal(e.Content, &payload); err != nil {
|
||||
util.GetLogger(t.context).WithError(err).Error("Failed to unmarshal device list update event")
|
||||
continue
|
||||
return
|
||||
}
|
||||
var inputRes keyapi.InputDeviceListUpdateResponse
|
||||
t.keyAPI.InputDeviceListUpdate(context.Background(), &keyapi.InputDeviceListUpdateRequest{
|
||||
|
|
@ -325,10 +333,6 @@ func (t *txnReq) processEDUs(edus []gomatrixserverlib.EDU) {
|
|||
if inputRes.Error != nil {
|
||||
util.GetLogger(t.context).WithError(inputRes.Error).WithField("user_id", payload.UserID).Error("failed to InputDeviceListUpdate")
|
||||
}
|
||||
default:
|
||||
util.GetLogger(t.context).WithField("type", e.Type).Warn("unhandled edu")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *txnReq) processEvent(e gomatrixserverlib.Event, isInboundTxn bool) error {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,12 @@ func (a *KeyInternalAPI) InputDeviceListUpdate(
|
|||
}
|
||||
// ALWAYS emit key changes when we've been poked over federation just in case
|
||||
// this poke is important for something.
|
||||
a.Producer.ProduceKeyChanges(keys)
|
||||
err = a.Producer.ProduceKeyChanges(keys)
|
||||
if err != nil {
|
||||
res.Error = &api.KeyError{
|
||||
Err: fmt.Sprintf("failed to emit remote device key changes: %s", err),
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue