summaryrefslogtreecommitdiff
path: root/plugins/Dbx_sqlite/src/dbevents.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2020-11-22 22:58:16 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2020-11-22 22:58:16 +0300
commitb6216145513ed25b87a0f27f6554921b42adfea0 (patch)
tree085b5a4912b92ba8a1beab1d7fe010294658249e /plugins/Dbx_sqlite/src/dbevents.cpp
parent1198e47c25e12a4743b97674f254f13c6bc0bead (diff)
dbx_sqlite: logic fix
Diffstat (limited to 'plugins/Dbx_sqlite/src/dbevents.cpp')
-rwxr-xr-xplugins/Dbx_sqlite/src/dbevents.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp
index dd469cdf78..1791280c87 100755
--- a/plugins/Dbx_sqlite/src/dbevents.cpp
+++ b/plugins/Dbx_sqlite/src/dbevents.cpp
@@ -573,13 +573,15 @@ MEVENT CDbxSQLite::FindNextEvent(MCONTACT hContact, MEVENT hDbEvent)
{
evt_cur_fwd = evt_stmts_prep[SQL_EVT_STMT_FINDFIRST];
sqlite3_bind_int64(evt_cur_fwd, 1, hContact);
-
- /* return 0; */
+ evt_cnt_fwd = hContact;
}
-/* if (hContact != evt_cnt_fwd)
+ else if (hContact != evt_cnt_fwd)
{
- return 0;
- } */
+ sqlite3_reset(evt_cur_fwd);
+ evt_cur_fwd = evt_stmts_prep[SQL_EVT_STMT_FINDFIRST];
+ sqlite3_bind_int64(evt_cur_fwd, 1, hContact);
+ evt_cnt_fwd = hContact;
+ }
while (hDbEvent != sqlite3_column_int64(evt_cur_fwd, 0))
{
@@ -624,12 +626,15 @@ MEVENT CDbxSQLite::FindPrevEvent(MCONTACT hContact, MEVENT hDbEvent)
{
evt_cur_backwd = evt_stmts_prep[SQL_EVT_STMT_FINDLAST];
sqlite3_bind_int64(evt_cur_backwd, 1, hContact);
- /* return 0; */
+ evt_cnt_backwd = hContact;
}
-/* if (hContact != evt_cnt_backwd)
+ else if (hContact != evt_cnt_backwd)
{
- return 0;
- } */
+ sqlite3_reset(evt_cur_fwd);
+ evt_cur_backwd = evt_stmts_prep[SQL_EVT_STMT_FINDLAST];
+ sqlite3_bind_int64(evt_cur_backwd, 1, hContact);
+ evt_cnt_backwd = hContact;
+ }
while (hDbEvent != sqlite3_column_int64(evt_cur_backwd, 0))
{