From 017d9fc6876f3cb8d1c37a3838da7246c5a5d3d0 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Sat, 31 Jul 2021 19:18:01 +0200 Subject: [PATCH] Update presence table --- userapi/storage/presence/postgres/presence_table.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/userapi/storage/presence/postgres/presence_table.go b/userapi/storage/presence/postgres/presence_table.go index 81a82cc48..010578103 100644 --- a/userapi/storage/presence/postgres/presence_table.go +++ b/userapi/storage/presence/postgres/presence_table.go @@ -35,7 +35,7 @@ CREATE TABLE IF NOT EXISTS presence_presences ( -- The actual presence presence INT NOT NULL, -- The status message - status_msg TEXT, + status_msg TEXT NOT NULL, -- The last time an action was received by this user last_active_ts BIGINT NOT NULL, CONSTRAINT presence_presences_unique UNIQUE (user_id) @@ -102,13 +102,7 @@ func (p *presenceStatements) UpsertPresence( lastActiveTS int64, ) (pos int64, err error) { stmt := sqlutil.TxStmt(txn, p.upsertPresenceStmt) - msg := &statusMsg - // avoid clearing status_msg when going idle - // makes it impossible to delete status_msg, though.. - if statusMsg == "" { - msg = nil - } - err = stmt.QueryRowContext(ctx, userID, presence, msg, lastActiveTS).Scan(&pos) + err = stmt.QueryRowContext(ctx, userID, presence, statusMsg, lastActiveTS).Scan(&pos) return }