summaryrefslogtreecommitdiff
path: root/plugins/RecentContacts/src
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/RecentContacts/src
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/RecentContacts/src')
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp46
1 files changed, 16 insertions, 30 deletions
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index c68219706b..8099152f09 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -382,39 +382,25 @@ INT_PTR OnMenuCommandShowList(WPARAM wParam, LPARAM lParam)
HANDLE curContact = db_find_first();
for (; curContact != NULL; curContact = db_find_next(curContact))
{
-// if (IsMessageAPI)
- {
- curTime = ((__time64_t)db_get_dw(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeLo, -1)) |
- (((__time64_t)db_get_dw(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeHi, -1)) << 32);
- //use TabSRMM last used time. ! NOT used, because bug: TabSRMM reset last used time to time when miranda started at miranda start!
- //t = ((DWORD)db_get_dw(curContact, "Tab_SRMsg", "isRecent", -1));
- //if (t != -1)
- //{
- // if (curTime == -1 || (__time64_t)t > curTime)
- // curTime = (__time64_t)t;
- //}
- }
-// else
- {
- curEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)curContact, 0);
- if (curEvent != NULL)
- {
- for ( ; curEvent != NULL; curEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)curEvent, 0))
- {
- dbe.cbBlob = 1;
- if (CallService(MS_DB_EVENT_GET, (WPARAM)curEvent, (LPARAM)&dbe) != 0)
- {
- curEvent = NULL;
- break;
- }
- if ((dbe.flags & (DBEF_READ | DBEF_SENT)) && dbe.eventType < 2000)
- break;
+ curTime = ((__time64_t)db_get_dw(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeLo, -1)) |
+ (((__time64_t)db_get_dw(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeHi, -1)) << 32);
+
+ curEvent = db_event_last(curContact);
+ if (curEvent != NULL) {
+ for ( ; curEvent != NULL; curEvent = db_event_prev(curEvent)) {
+ dbe.cbBlob = 1;
+ if (db_event_get(curEvent, &dbe) != 0) {
+ curEvent = NULL;
+ break;
}
- if (curEvent != NULL)
- if (curTime == -1 || (__time64_t)dbe.timestamp > curTime)
- curTime = (__time64_t)dbe.timestamp;
+ if ((dbe.flags & (DBEF_READ | DBEF_SENT)) && dbe.eventType < 2000)
+ break;
}
+ if (curEvent != NULL)
+ if (curTime == -1 || (__time64_t)dbe.timestamp > curTime)
+ curTime = (__time64_t)dbe.timestamp;
}
+
if (curTime != -1)
contacts->insert(cpair(curTime, curContact));
}