Remove userID, as it's not in the spec

This commit is contained in:
Till Faelligen 2022-02-25 15:07:56 +01:00
parent d9b1d0129f
commit 8fc1fb4d0e

View file

@ -30,7 +30,6 @@ import (
// https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-devices // https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-devices
type deviceJSON struct { type deviceJSON struct {
UserID string `json:"user_id"`
DeviceID string `json:"device_id"` DeviceID string `json:"device_id"`
DisplayName string `json:"display_name"` DisplayName string `json:"display_name"`
LastSeenIP string `json:"last_seen_ip"` LastSeenIP string `json:"last_seen_ip"`
@ -79,7 +78,6 @@ func GetDeviceByID(
return util.JSONResponse{ return util.JSONResponse{
Code: http.StatusOK, Code: http.StatusOK,
JSON: deviceJSON{ JSON: deviceJSON{
UserID: targetDevice.UserID,
DeviceID: targetDevice.ID, DeviceID: targetDevice.ID,
DisplayName: targetDevice.DisplayName, DisplayName: targetDevice.DisplayName,
LastSeenIP: stripIPPort(targetDevice.LastSeenIP), LastSeenIP: stripIPPort(targetDevice.LastSeenIP),
@ -105,7 +103,6 @@ func GetDevicesByLocalpart(
for _, dev := range queryRes.Devices { for _, dev := range queryRes.Devices {
res.Devices = append(res.Devices, deviceJSON{ res.Devices = append(res.Devices, deviceJSON{
UserID: dev.UserID,
DeviceID: dev.ID, DeviceID: dev.ID,
DisplayName: dev.DisplayName, DisplayName: dev.DisplayName,
LastSeenIP: stripIPPort(dev.LastSeenIP), LastSeenIP: stripIPPort(dev.LastSeenIP),