diff --git a/userapi/api/api.go b/userapi/api/api.go index a7539d098..6c3f3c69c 100644 --- a/userapi/api/api.go +++ b/userapi/api/api.go @@ -228,6 +228,7 @@ type Device struct { DisplayName string LastSeenTS int64 LastSeenIP string + UserAgent string } // Account represents a Matrix account on this home server. diff --git a/userapi/storage/devices/postgres/devices_table.go b/userapi/storage/devices/postgres/devices_table.go index 5954cace1..2a4d337c7 100644 --- a/userapi/storage/devices/postgres/devices_table.go +++ b/userapi/storage/devices/postgres/devices_table.go @@ -170,6 +170,7 @@ func (s *devicesStatements) insertDevice( SessionID: sessionID, LastSeenTS: createdTimeMS, LastSeenIP: ipAddr, + UserAgent: userAgent, }, nil } diff --git a/userapi/storage/devices/sqlite3/devices_table.go b/userapi/storage/devices/sqlite3/devices_table.go index 62ff343cb..6b0de10ee 100644 --- a/userapi/storage/devices/sqlite3/devices_table.go +++ b/userapi/storage/devices/sqlite3/devices_table.go @@ -164,6 +164,7 @@ func (s *devicesStatements) insertDevice( SessionID: sessionID, LastSeenTS: createdTimeMS, LastSeenIP: ipAddr, + UserAgent: userAgent, }, nil }