mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 03:03:10 -06:00
Don't send device list updates for appservice devices
This commit is contained in:
parent
9313c6500a
commit
65382791af
|
|
@ -135,6 +135,7 @@ func generateAppServiceAccount(
|
||||||
AccessToken: as.ASToken,
|
AccessToken: as.ASToken,
|
||||||
DeviceID: &as.SenderLocalpart,
|
DeviceID: &as.SenderLocalpart,
|
||||||
DeviceDisplayName: &as.SenderLocalpart,
|
DeviceDisplayName: &as.SenderLocalpart,
|
||||||
|
NoDeviceListUpdate: true,
|
||||||
}, &devRes)
|
}, &devRes)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -290,6 +290,10 @@ type PerformDeviceCreationRequest struct {
|
||||||
IPAddr string
|
IPAddr string
|
||||||
// Useragent for this device
|
// Useragent for this device
|
||||||
UserAgent string
|
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
|
// PerformDeviceCreationResponse is the response for PerformDeviceCreation
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,9 @@ func (a *UserInternalAPI) PerformDeviceCreation(ctx context.Context, req *api.Pe
|
||||||
}
|
}
|
||||||
res.DeviceCreated = true
|
res.DeviceCreated = true
|
||||||
res.Device = dev
|
res.Device = dev
|
||||||
|
if req.NoDeviceListUpdate {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
// create empty device keys and upload them to trigger device list changes
|
// create empty device keys and upload them to trigger device list changes
|
||||||
return a.deviceListUpdate(dev.UserID, []string{dev.ID})
|
return a.deviceListUpdate(dev.UserID, []string{dev.ID})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue