mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Various refactoring
This commit is contained in:
parent
ed4097825b
commit
62bcd5ad4b
13 changed files with 178 additions and 182 deletions
|
@ -150,12 +150,13 @@ func (a *UserInternalAPI) PerformDeviceDeletion(ctx context.Context, req *api.Pe
|
|||
}
|
||||
|
||||
func (a *UserInternalAPI) deviceListUpdate(userID string, deviceIDs []string) error {
|
||||
deviceKeys := make([]keyapi.DeviceKeys, len(deviceIDs))
|
||||
deviceKeys := make([]gomatrixserverlib.DeviceKeys, len(deviceIDs))
|
||||
for i, did := range deviceIDs {
|
||||
deviceKeys[i] = keyapi.DeviceKeys{
|
||||
UserID: userID,
|
||||
DeviceID: did,
|
||||
KeyJSON: nil,
|
||||
deviceKeys[i] = gomatrixserverlib.DeviceKeys{
|
||||
RespUserDeviceKeys: gomatrixserverlib.RespUserDeviceKeys{
|
||||
UserID: userID,
|
||||
DeviceID: did,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -219,12 +220,15 @@ func (a *UserInternalAPI) PerformDeviceUpdate(ctx context.Context, req *api.Perf
|
|||
var uploadRes keyapi.PerformUploadKeysResponse
|
||||
a.KeyAPI.PerformUploadKeys(context.Background(), &keyapi.PerformUploadKeysRequest{
|
||||
UserID: req.RequestingUserID,
|
||||
DeviceKeys: []keyapi.DeviceKeys{
|
||||
DeviceKeys: []gomatrixserverlib.DeviceKeys{
|
||||
{
|
||||
DeviceID: dev.ID,
|
||||
DisplayName: *req.DisplayName,
|
||||
KeyJSON: nil,
|
||||
UserID: dev.UserID,
|
||||
RespUserDeviceKeys: gomatrixserverlib.RespUserDeviceKeys{
|
||||
DeviceID: dev.ID,
|
||||
UserID: dev.UserID,
|
||||
},
|
||||
Unsigned: map[string]interface{}{
|
||||
"device_display_name": *req.DisplayName,
|
||||
},
|
||||
},
|
||||
},
|
||||
OnlyDisplayNameUpdates: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue