summaryrefslogtreecommitdiff
path: root/plugins/FavContacts/src/contact_cache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/FavContacts/src/contact_cache.cpp')
-rw-r--r--plugins/FavContacts/src/contact_cache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp
index e3b05f2c24..42f46da620 100644
--- a/plugins/FavContacts/src/contact_cache.cpp
+++ b/plugins/FavContacts/src/contact_cache.cpp
@@ -84,7 +84,8 @@ void CContactCache::Rebuild()
info->hContact = hContact;
info->rate = 0;
- for (MEVENT hEvent = db_event_last(hContact); hEvent; hEvent = db_event_prev(hContact, hEvent)) {
+ DB::ECPTR cursor(DB::EventsRev(hContact));
+ while (MEVENT hEvent = cursor.FetchNext()) {
DBEVENTINFO dbei = {};
if (!db_event_get(hEvent, &dbei)) {
if (float weight = GetEventWeight(timestamp - dbei.timestamp)) {