From 4ca162cb98202df3ce261680b96882a87c8aae67 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Fri, 2 Oct 2020 22:21:20 +0200 Subject: [PATCH] Add UserAgent to Device --- userapi/api/api.go | 1 + userapi/storage/devices/postgres/devices_table.go | 1 + userapi/storage/devices/sqlite3/devices_table.go | 1 + 3 files changed, 3 insertions(+) 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 }