mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 19:23:10 -06:00
Get device names from unsigned in /user/devices
This commit is contained in:
parent
d28d0ee66e
commit
0364c6232c
|
|
@ -20,6 +20,7 @@ import (
|
|||
keyapi "github.com/matrix-org/dendrite/keyserver/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
// GetUserDevices for the given user id
|
||||
|
|
@ -69,9 +70,14 @@ func GetUserDevices(
|
|||
continue
|
||||
}
|
||||
|
||||
displayName := dev.DisplayName
|
||||
if dev.DisplayName == "" {
|
||||
displayName = gjson.GetBytes(dev.DeviceKeys.KeyJSON, "unsigned.device_display_name").Str
|
||||
}
|
||||
|
||||
device := gomatrixserverlib.RespUserDevice{
|
||||
DeviceID: dev.DeviceID,
|
||||
DisplayName: dev.DisplayName,
|
||||
DisplayName: displayName,
|
||||
Keys: key,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue