From 01b7a72d43ed1c71544c22c7afb61829762ffe8e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 23 Jun 2013 22:02:44 +0000 Subject: same for some another plugins git-svn-id: http://svn.miranda-ng.org/main/trunk@5104 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ConnectionNotify/src/ConnectionNotify.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'plugins/ConnectionNotify/src/ConnectionNotify.cpp') diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 797a458851..b1d8f294ac 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -849,7 +849,7 @@ static unsigned __stdcall checkthread(void *dummy) cur=conn; while(cur!=NULL) { - if (searchConnection(first,cur->strIntIp,cur->strExtIp,cur->intIntPort,cur->intExtPort,cur->state)==NULL && settingStatusMask&1<state-1) + if (searchConnection(first,cur->strIntIp,cur->strExtIp,cur->intIntPort,cur->intExtPort,cur->state)==NULL && (settingStatusMask & (1 << (cur->state-1)))) { @@ -1044,16 +1044,11 @@ extern "C" int __declspec(dllexport) Load(void) pd.type=PROTOTYPE_PROTOCOL; CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd); //set all contacts to offline - { - HANDLE hContact; - hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); - while(hContact!=NULL) { - if(!lstrcmpA(PLUGINNAME,(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0))) { - db_set_w(hContact,PLUGINNAME,"status",ID_STATUS_OFFLINE); - } - hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0); - } - } + + for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) + if(!lstrcmpA(PLUGINNAME,(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0))) + db_set_w(hContact,PLUGINNAME,"status",ID_STATUS_OFFLINE); + mir_snprintf(service,sizeof(service), "%s%s", PLUGINNAME, PS_GETCAPS); CreateServiceFunction(service, (MIRANDASERVICE)GetCaps); mir_snprintf(service,sizeof(service), "%s%s", PLUGINNAME, PS_GETNAME); -- cgit v1.2.3