diff options
| author | George Hazan <george.hazan@gmail.com> | 2013-06-23 22:02:44 +0000 | 
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2013-06-23 22:02:44 +0000 | 
| commit | 01b7a72d43ed1c71544c22c7afb61829762ffe8e (patch) | |
| tree | b4c570f41c69097492329b9d18a64f0b42f585ef /plugins/ConnectionNotify/src | |
| parent | 037286255b6a26ed5fba94c5fe9e68b88c1755f7 (diff) | |
same for some another plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@5104 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ConnectionNotify/src')
| -rw-r--r-- | plugins/ConnectionNotify/src/ConnectionNotify.cpp | 17 | 
1 files changed, 6 insertions, 11 deletions
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<<cur->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);
  | 
