mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Various refactoring
This commit is contained in:
parent
ed4097825b
commit
62bcd5ad4b
13 changed files with 178 additions and 182 deletions
|
@ -13,7 +13,6 @@
|
|||
package routing
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||
|
@ -44,17 +43,10 @@ func GetUserDevices(
|
|||
}
|
||||
|
||||
for _, dev := range res.Devices {
|
||||
var key gomatrixserverlib.RespUserDeviceKeys
|
||||
err := json.Unmarshal(dev.DeviceKeys.KeyJSON, &key)
|
||||
if err != nil {
|
||||
util.GetLogger(req.Context()).WithError(err).Warnf("malformed device key: %s", string(dev.DeviceKeys.KeyJSON))
|
||||
continue
|
||||
}
|
||||
|
||||
device := gomatrixserverlib.RespUserDevice{
|
||||
DeviceID: dev.DeviceID,
|
||||
DisplayName: dev.DisplayName,
|
||||
Keys: key,
|
||||
DisplayName: dev.DisplayName(),
|
||||
Keys: dev.RespUserDeviceKeys,
|
||||
}
|
||||
response.Devices = append(response.Devices, device)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue