Return user_id and stream_id in federated devices query (#1040)

main
Neil Alexander 2020-05-15 12:07:51 +01:00 committed by GitHub
parent f0e0a6668f
commit 773d5bb9f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -23,6 +23,8 @@ import (
)
type userDevicesResponse struct {
UserID string `json:"user_id"`
StreamID int `json:"stream_id"`
Devices []authtypes.Device `json:"devices"`
}
@ -48,6 +50,12 @@ func GetUserDevices(
return util.JSONResponse{
Code: 200,
JSON: userDevicesResponse{devs},
// TODO: we should return an incrementing stream ID each time the device
// list changes for delta changes to be recognised
JSON: userDevicesResponse{
UserID: userID,
StreamID: 0,
Devices: devs,
},
}
}