From 1198e47c25e12a4743b97674f254f13c6bc0bead Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sun, 22 Nov 2020 22:11:21 +0300 Subject: someone told me what prev/next only can be called after last/first.... looks like it is not true --- plugins/Dbx_sqlite/src/dbevents.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'plugins/Dbx_sqlite/src') diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index 4b5c3e80de..dd469cdf78 100755 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -571,12 +571,15 @@ MEVENT CDbxSQLite::FindNextEvent(MCONTACT hContact, MEVENT hDbEvent) if (!evt_cur_fwd) { - return 0; + evt_cur_fwd = evt_stmts_prep[SQL_EVT_STMT_FINDFIRST]; + sqlite3_bind_int64(evt_cur_fwd, 1, hContact); + + /* return 0; */ } - if (hContact != evt_cnt_fwd) +/* if (hContact != evt_cnt_fwd) { return 0; - } + } */ while (hDbEvent != sqlite3_column_int64(evt_cur_fwd, 0)) { @@ -619,12 +622,14 @@ MEVENT CDbxSQLite::FindPrevEvent(MCONTACT hContact, MEVENT hDbEvent) if (!evt_cur_backwd) { - return 0; + evt_cur_backwd = evt_stmts_prep[SQL_EVT_STMT_FINDLAST]; + sqlite3_bind_int64(evt_cur_backwd, 1, hContact); + /* return 0; */ } - if (hContact != evt_cnt_backwd) +/* if (hContact != evt_cnt_backwd) { return 0; - } + } */ while (hDbEvent != sqlite3_column_int64(evt_cur_backwd, 0)) { -- cgit v1.2.3