summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-01-08 21:39:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-01-08 21:39:56 +0300
commit2bf9d8e3bc1e51e28a94f8e5bbdd685fa0a71279 (patch)
tree63d0e6fa1f93730695aba995df513ed3044f5fef /plugins
parent266bbc5666045ad1db2d070a1cf964279a82a43f (diff)
Import to use faster cursors
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Import/src/import.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp
index 8ebafa0aa4..22716620bf 100644
--- a/plugins/Import/src/import.cpp
+++ b/plugins/Import/src/import.cpp
@@ -878,8 +878,11 @@ void CImportBatch::ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int
BYTE *eventBuf = (PBYTE)mir_alloc(cbAlloc);
// Get the start of the event chain
- MEVENT hEvent = srcDb->FindFirstEvent(hContact);
- for (int i = 0; hEvent; i++, hEvent = srcDb->FindNextEvent(hContact, hEvent)) {
+ int i = 0;
+ DB::ECPTR pCursor(srcDb->EventCursor(hContact, 0));
+ while (MEVENT hEvent = pCursor.FetchNext()) {
+ i++;
+
// Copy the event and import it
DBEVENTINFO dbei = {};
dbei.cbBlob = srcDb->GetBlobSize(hEvent);