diff options
author | George Hazan <ghazan@miranda.im> | 2020-05-14 12:34:32 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-05-14 12:34:32 +0300 |
commit | 5a09915186e4ae70cc39e9343ca02a1b860d7f94 (patch) | |
tree | ba115287c182bc8dae3308fc23f8d197d68850cb /plugins/CmdLine/src | |
parent | 2b30685427500c9eedac4c0c4862b32af144a90c (diff) |
simple database event cycles moved to cursors
Diffstat (limited to 'plugins/CmdLine/src')
-rw-r--r-- | plugins/CmdLine/src/mimcmd_handlers.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 74bfa10f37..7427dc3257 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1348,12 +1348,13 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re int count = stop - start + 1;
if (count > 0) {
int index = 0;
- MEVENT hEvent = db_event_first(hContact);
+
DBEVENTINFO dbEvent = {};
char message[4096];
dbEvent.pBlob = (PBYTE)message;
- while (hEvent) {
+ DB::ECPTR pCursor(DB::Events(hContact));
+ while (MEVENT hEvent = pCursor.FetchNext()) {
dbEvent.cbBlob = _countof(message);
if (!db_event_get(hEvent, &dbEvent)) { // if successful call
dbEvent.pBlob[dbEvent.cbBlob] = 0;
@@ -1364,7 +1365,6 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re if (index > stop)
break;
- hEvent = db_event_next(hContact, hEvent);
index++;
}
}
|