mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Don't send device list updates for appservice devices
This commit is contained in:
parent
9313c6500a
commit
65382791af
|
|
@ -131,10 +131,11 @@ func generateAppServiceAccount(
|
|||
}
|
||||
var devRes userapi.PerformDeviceCreationResponse
|
||||
err = userAPI.PerformDeviceCreation(context.Background(), &userapi.PerformDeviceCreationRequest{
|
||||
Localpart: as.SenderLocalpart,
|
||||
AccessToken: as.ASToken,
|
||||
DeviceID: &as.SenderLocalpart,
|
||||
DeviceDisplayName: &as.SenderLocalpart,
|
||||
Localpart: as.SenderLocalpart,
|
||||
AccessToken: as.ASToken,
|
||||
DeviceID: &as.SenderLocalpart,
|
||||
DeviceDisplayName: &as.SenderLocalpart,
|
||||
NoDeviceListUpdate: true,
|
||||
}, &devRes)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -290,6 +290,10 @@ type PerformDeviceCreationRequest struct {
|
|||
IPAddr string
|
||||
// Useragent for this device
|
||||
UserAgent string
|
||||
// NoDeviceListUpdate determines whether we should avoid sending a device list
|
||||
// update for this account. Generally the only reason to do this is if the account
|
||||
// is an appservice account.
|
||||
NoDeviceListUpdate bool
|
||||
}
|
||||
|
||||
// PerformDeviceCreationResponse is the response for PerformDeviceCreation
|
||||
|
|
|
|||
|
|
@ -119,6 +119,9 @@ func (a *UserInternalAPI) PerformDeviceCreation(ctx context.Context, req *api.Pe
|
|||
}
|
||||
res.DeviceCreated = true
|
||||
res.Device = dev
|
||||
if req.NoDeviceListUpdate {
|
||||
return nil
|
||||
}
|
||||
// create empty device keys and upload them to trigger device list changes
|
||||
return a.deviceListUpdate(dev.UserID, []string{dev.ID})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue