aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-05-15 12:07:51 +0100
committerGitHub <noreply@github.com>2020-05-15 12:07:51 +0100
commit773d5bb9f99a6cc36d284a2fbea933f8d9e7753b (patch)
tree83058b8c84e29d9dd43afbc65699aece01d39e18
parentf0e0a6668f5c44e384c26d5afb3b70c816e3fbff (diff)
Return user_id and stream_id in federated devices query (#1040)
-rw-r--r--federationapi/routing/devices.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/federationapi/routing/devices.go b/federationapi/routing/devices.go
index 01647a61..49686c76 100644
--- a/federationapi/routing/devices.go
+++ b/federationapi/routing/devices.go
@@ -23,7 +23,9 @@ import (
)
type userDevicesResponse struct {
- Devices []authtypes.Device `json:"devices"`
+ UserID string `json:"user_id"`
+ StreamID int `json:"stream_id"`
+ Devices []authtypes.Device `json:"devices"`
}
// GetUserDevices for the given user id
@@ -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,
+ },
}
}