summaryrefslogtreecommitdiff
path: root/plugins/FavContacts
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-30 17:32:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-30 17:32:39 +0000
commit109877a3c75cb290c55755dcfc88794d2453669d (patch)
tree3ede8b9170b2fc3f6f35dc2cea6742d44b19d631 /plugins/FavContacts
parentfee8d991bdf4a59b563d1b92165ea0ed2f7bacb8 (diff)
MS_DB_EVENT_* services remained, but their calls removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@4255 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FavContacts')
-rw-r--r--plugins/FavContacts/src/contact_cache.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp
index e535738ffb..1167d98f0d 100644
--- a/plugins/FavContacts/src/contact_cache.cpp
+++ b/plugins/FavContacts/src/contact_cache.cpp
@@ -7,7 +7,7 @@ int __cdecl CContactCache::OnDbEventAdded(WPARAM wParam, LPARAM lParam)
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
- CallService(MS_DB_EVENT_GET, (WPARAM)hEvent, (LPARAM)&dbei);
+ db_event_get(hEvent, &dbei);
if (dbei.eventType != EVENTTYPE_MESSAGE) return 0;
float weight = GetEventWeight(time(NULL) - dbei.timestamp);
@@ -88,23 +88,19 @@ void CContactCache::Rebuild()
info->hContact = hContact;
info->rate = 0;
- HANDLE hEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hContact, 0);
+ HANDLE hEvent = db_event_last(hContact);
while (hEvent)
{
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
- if (!CallService(MS_DB_EVENT_GET, (WPARAM)hEvent, (LPARAM)&dbei))
- {
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if (!db_event_get(hEvent, &dbei)) {
if (float weight = GetEventWeight(timestamp - dbei.timestamp))
{
if (dbei.eventType == EVENTTYPE_MESSAGE)
info->rate += weight;
- } else
- {
- break;
}
+ else break;
}
- hEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hEvent, 0);
+ hEvent = db_event_prev(hEvent);
}
m_cache.insert(info);