summaryrefslogtreecommitdiff
path: root/plugins/ContactsPlus/src/main.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2012-12-29 21:14:47 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2012-12-29 21:14:47 +0000
commit888027b83e0c293e3f6f0be3215ca0b212c720cc (patch)
tree4659e5cd8492dd35480b902da9909d6d3bbd3f56 /plugins/ContactsPlus/src/main.cpp
parent9a73a925c87a152bfa1bb92d88b4b480e0df174c (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@2885 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ContactsPlus/src/main.cpp')
-rw-r--r--plugins/ContactsPlus/src/main.cpp63
1 files changed, 26 insertions, 37 deletions
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index c64acaf38a..d6aff5d371 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -107,48 +107,37 @@ static int HookDBEventAdded(WPARAM wParam, LPARAM lParam)
static void ProcessUnreadEvents(void)
{
- DBEVENTINFO dbei = {0};
- HANDLE hDbEvent,hContact;
-
- dbei.cbSize = sizeof(dbei);
-
- hContact = SRCFindFirstContact();
- while (hContact)
- {
- hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD,(WPARAM)hContact,0);
-
- while (hDbEvent)
- {
- dbei.cbBlob=0;
- CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
- if (!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType==EVENTTYPE_CONTACTS)
- { //process the event
- HookDBEventAdded((WPARAM)hContact, (LPARAM)hDbEvent);
- }
- hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT,(WPARAM)hDbEvent,0);
- }
- hContact = SRCFindNextContact(hContact);
- }
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+
+ HANDLE hContact = db_find_first();
+ while (hContact)
+ {
+ HANDLE hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD,(WPARAM)hContact,0);
+
+ while (hDbEvent)
+ {
+ dbei.cbBlob=0;
+ CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
+ if (!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType==EVENTTYPE_CONTACTS)
+ {
+ //process the event
+ HookDBEventAdded((WPARAM)hContact, (LPARAM)hDbEvent);
+ }
+ hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT,(WPARAM)hDbEvent,0);
+ }
+ hContact = db_find_next(hContact);
+ }
}
static bool CheckContactsServiceSupport(const char* szProto)
{
- if (g_NewProtoAPI)
- { // there is no way to determine if the service exists (only proto_interface call is supported by 0.8+)
- if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_CONTACTSEND)
- return true;
- }
- else
- { // check the real send service (only 0.7.x and older)
- char serstr[MAX_PATH+30];
-
- strcpy(serstr, szProto);
- strcat(serstr, PSS_CONTACTS);
- if (ServiceExists(serstr))
- return true;
- }
- return false;
+ // there is no way to determine if the service exists (only proto_interface call is supported by 0.8+)
+ if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_CONTACTSEND)
+ return true;
+ else
+ return false;
}