summaryrefslogtreecommitdiff
path: root/plugins/Dbx_sqlite/src/dbevents.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-03-29 13:03:28 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-03-29 13:03:28 +0300
commit0020987797513c29721eca71f39f2b58e646f2dc (patch)
tree91c1823778026a3beadfb624a95c7b09dd967023 /plugins/Dbx_sqlite/src/dbevents.cpp
parent7b69f626542092044e9a0372b4bb7a977d0130a5 (diff)
db_event_edit to change server id, user id & reply id as well
Diffstat (limited to 'plugins/Dbx_sqlite/src/dbevents.cpp')
-rw-r--r--plugins/Dbx_sqlite/src/dbevents.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp
index 55d4cd70aa..0d41744ba3 100644
--- a/plugins/Dbx_sqlite/src/dbevents.cpp
+++ b/plugins/Dbx_sqlite/src/dbevents.cpp
@@ -279,9 +279,9 @@ BOOL CDbxSQLite::EditEvent(MEVENT hDbEvent, const DBEVENTINFO *dbei)
mir_cslockfull lock(m_csDbAccess);
sqlite3_stmt *stmt;
if (tmp.pBlob)
- stmt = InitQuery("UPDATE events SET module = ?, timestamp = ?, type = ?, flags = ?, data = ?, is_read = ? WHERE id = ?;", qEvEdit1);
+ stmt = InitQuery("UPDATE events SET module = ?, timestamp = ?, type = ?, flags = ?, data = ?, is_read = ?, server_id = ?, user_id = ?, reply_id = ? WHERE id = ?;", qEvEdit1);
else
- stmt = InitQuery("UPDATE events SET module = ?, timestamp = ?, type = ?, flags = ?, is_read = ? WHERE id = ?;", qEvEdit2);
+ stmt = InitQuery("UPDATE events SET module = ?, timestamp = ?, type = ?, flags = ?, is_read = ?, server_id = ?, user_id = ?, reply_id = ? WHERE id = ?;", qEvEdit2);
int i = 1;
sqlite3_bind_text(stmt, i++, tmp.szModule, (int)mir_strlen(tmp.szModule), nullptr);
@@ -291,6 +291,9 @@ BOOL CDbxSQLite::EditEvent(MEVENT hDbEvent, const DBEVENTINFO *dbei)
if (tmp.pBlob)
sqlite3_bind_blob(stmt, i++, tmp.pBlob, tmp.cbBlob, nullptr);
sqlite3_bind_int(stmt, i++, tmp.markedRead());
+ sqlite3_bind_text(stmt, i++, tmp.szId, (int)mir_strlen(tmp.szId), nullptr);
+ sqlite3_bind_text(stmt, i++, tmp.szUserId, (int)mir_strlen(tmp.szUserId), nullptr);
+ sqlite3_bind_text(stmt, i++, tmp.szReplyId, (int)mir_strlen(tmp.szReplyId), nullptr);
sqlite3_bind_int64(stmt, i++, hDbEvent);
int rc = sqlite3_step(stmt);
logError(rc, __FILE__, __LINE__);