mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Fixes
This commit is contained in:
parent
9d69340ef1
commit
0d511c623b
2 changed files with 3 additions and 9 deletions
|
@ -391,9 +391,6 @@ func (u *DeviceListUpdater) updateDeviceList(res *gomatrixserverlib.RespUserDevi
|
||||||
RespUserDeviceKeys: device.Keys,
|
RespUserDeviceKeys: device.Keys,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if device.DeviceID != "" {
|
|
||||||
keys[i].DeviceKeys.DeviceID = device.DeviceID
|
|
||||||
}
|
|
||||||
if device.DisplayName != "" {
|
if device.DisplayName != "" {
|
||||||
keys[i].DeviceKeys.Unsigned = map[string]interface{}{
|
keys[i].DeviceKeys.Unsigned = map[string]interface{}{
|
||||||
"device_display_name": device.DisplayName,
|
"device_display_name": device.DisplayName,
|
||||||
|
@ -412,10 +409,6 @@ func (u *DeviceListUpdater) updateDeviceList(res *gomatrixserverlib.RespUserDevi
|
||||||
"failed to query device keys json for calculating diffs",
|
"failed to query device keys json for calculating diffs",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("EXISTING KEYS:", existingKeys[0].Unsigned)
|
|
||||||
fmt.Println("NEW KEYS:", keys[0].Unsigned)
|
|
||||||
|
|
||||||
err := u.db.StoreRemoteDeviceKeys(ctx, keys, []string{res.UserID})
|
err := u.db.StoreRemoteDeviceKeys(ctx, keys, []string{res.UserID})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to store remote device keys: %w", err)
|
return fmt.Errorf("failed to store remote device keys: %w", err)
|
||||||
|
|
|
@ -593,8 +593,9 @@ func appendDisplayNames(existing, new []api.DeviceMessage) []api.DeviceMessage {
|
||||||
if existingDevice.DeviceID != newDevice.DeviceID {
|
if existingDevice.DeviceID != newDevice.DeviceID {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
existingDevice.Unsigned["device_display_name"] = newDevice.DisplayName()
|
existing[i].Unsigned = map[string]interface{}{
|
||||||
existing[i] = existingDevice
|
"device_display_name": newDevice.DisplayName(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return existing
|
return existing
|
||||||
|
|
Loading…
Reference in a new issue