From 911fdd37f071deadbc0dd6482842d14533e6f9a5 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 5 Nov 2021 20:04:27 +0200 Subject: [PATCH] Fix bug in SQLStateStore.SetMember(). Closes #378 --- database/statestore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/statestore.go b/database/statestore.go index 94ebae8..f291dcb 100644 --- a/database/statestore.go +++ b/database/statestore.go @@ -179,7 +179,7 @@ func (store *SQLStateStore) SetMember(roomID id.RoomID, userID id.UserID, member var err error if store.db.dialect == "postgres" { _, err = store.db.Exec(`INSERT INTO mx_user_profile (room_id, user_id, membership, displayname, avatar_url) VALUES ($1, $2, $3, $4, $5) - ON CONFLICT (room_id, user_id) DO UPDATE SET membership=$3`, roomID, userID, member.Membership, member.Displayname, member.AvatarURL) + ON CONFLICT (room_id, user_id) DO UPDATE SET membership=$3, displayname=$4, avatar_url=$5`, roomID, userID, member.Membership, member.Displayname, member.AvatarURL) } else if store.db.dialect == "sqlite3" { _, err = store.db.Exec("INSERT OR REPLACE INTO mx_user_profile (room_id, user_id, membership, displayname, avatar_url) VALUES ($1, $2, $3, $4, $5)", roomID, userID, member.Membership, member.Displayname, member.AvatarURL)