diff options
| author | George Hazan <george.hazan@gmail.com> | 2012-11-20 13:36:00 +0000 | 
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2012-11-20 13:36:00 +0000 | 
| commit | 5b378496114ec47ffa27d3d9e7bc2a744d9e0a77 (patch) | |
| tree | f7550dadde23f61182af6e542101eb5fedfa2d85 /plugins/KeyboardNotify/src | |
| parent | 0ba80eef50988ca3e88a16839eaf0a840f1cb139 (diff) | |
- all xstatus services moved to m_xstatus.h
- old obsoleted services PS_GETXSTATUS & PS_SETXSTATUS removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@2390 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/KeyboardNotify/src')
| -rw-r--r-- | plugins/KeyboardNotify/src/Common.h | 2 | ||||
| -rw-r--r-- | plugins/KeyboardNotify/src/main.cpp | 34 | ||||
| -rw-r--r-- | plugins/KeyboardNotify/src/options.cpp | 8 | 
3 files changed, 21 insertions, 23 deletions
diff --git a/plugins/KeyboardNotify/src/Common.h b/plugins/KeyboardNotify/src/Common.h index 406f5c14ad..20b2f13d17 100644 --- a/plugins/KeyboardNotify/src/Common.h +++ b/plugins/KeyboardNotify/src/Common.h @@ -51,7 +51,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  #include <m_contacts.h>
  #include <m_message.h>
  #include <m_utils.h>
 -#include <m_icq.h>
 +#include <m_xstatus.h>
  #include <m_clc.h>
  #include <m_skin.h>
  #include <win2k.h>
 diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 7806e4c69d..02254e11ef 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -451,26 +451,24 @@ BOOL checkGlobalStatus()  BOOL checkGlobalXstatus()
  {
 -	ICQ_CUSTOM_STATUS xstatus={0};
 -	int i, protosSupporting, status=0;
 +	int protosSupporting=0, status=0;
 -	for(i=0, protosSupporting=0; i < ProtoList.protoCount; i++) {
 -		if (!ProtoList.protoInfo[i].enabled || !ProtoList.protoInfo[i].xstatus.count) continue;
 +	for (int i=0; i < ProtoList.protoCount; i++) {
 +		if ( !ProtoList.protoInfo[i].enabled || !ProtoList.protoInfo[i].xstatus.count)
 +			continue;
  		protosSupporting++;
  		// Retrieve xstatus for protocol
 -		xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
 +		CUSTOM_STATUS xstatus = { sizeof(CUSTOM_STATUS) };
  		xstatus.flags = CSSF_MASK_STATUS;
  		xstatus.status = &status;
 -		CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
 +		CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
 -		if (ProtoList.protoInfo[i].xstatus.enabled[status]) return TRUE;
 +		if (ProtoList.protoInfo[i].xstatus.enabled[status])
 +			return TRUE;
  	}
 -	if (!protosSupporting)
 -		return TRUE;
 -	else
 -		return FALSE;
 +	return protosSupporting == 0;
  }
 @@ -676,7 +674,7 @@ BOOL checkStatus(char *szProto)  BOOL checkXstatus(char *szProto)
  {
  	int status=0;
 -	ICQ_CUSTOM_STATUS xstatus={0};
 +	CUSTOM_STATUS xstatus={0};
  	if (!szProto)
  		return checkGlobalXstatus();
 @@ -686,10 +684,10 @@ BOOL checkXstatus(char *szProto)  			if (!ProtoList.protoInfo[i].xstatus.count) return TRUE;
  			// Retrieve xstatus for protocol
 -			xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
 +			xstatus.cbSize = sizeof(CUSTOM_STATUS);
  			xstatus.flags = CSSF_MASK_STATUS;
  			xstatus.status = &status;
 -			CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
 +			CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
  			return ProtoList.protoInfo[i].xstatus.enabled[status];
  		}
 @@ -962,16 +960,16 @@ void updateXstatusProto(PROTOCOL_INFO *protoInfo)  {
  	unsigned int i;
  	char szServiceName[MAXMODULELABELLENGTH];
 -	ICQ_CUSTOM_STATUS xstatus={0};
 +	CUSTOM_STATUS xstatus={0};
 -	mir_snprintf(szServiceName, sizeof(szServiceName), "%s%s", protoInfo->szProto, PS_ICQ_GETCUSTOMSTATUSEX);
 +	mir_snprintf(szServiceName, sizeof(szServiceName), "%s%s", protoInfo->szProto, PS_GETCUSTOMSTATUSEX);
  	if (!ServiceExists(szServiceName)) return;
  	// Retrieve xstatus.count
 -	xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
 +	xstatus.cbSize = sizeof(CUSTOM_STATUS);
  	xstatus.flags = CSSF_STATUSES_COUNT;
  	xstatus.wParam = &(protoInfo->xstatus.count);
 -	CallProtoService(protoInfo->szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
 +	CallProtoService(protoInfo->szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
  	(protoInfo->xstatus.count)++;	// Don't forget about xstatus=0 (None)
  	// Alloc and initiailize xstatus.enabled array
 diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index 7ef9db3380..49a3f3fd89 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -1443,22 +1443,22 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA  					hParent = TreeView_InsertItem(hwndTree, &tvis);
  					for(j = 0; j < XstatusListAux[i].count; j++) {
  						TCHAR szDefaultName[1024];
 -						ICQ_CUSTOM_STATUS xstatus={0};
 +						CUSTOM_STATUS xstatus={0};
  						tvis.hParent = hParent;
  						tvis.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
  						if (!j){
  							tvis.item.pszText = TranslateT("None"); }
  						else {
 -							xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
 +							xstatus.cbSize = sizeof(CUSTOM_STATUS);
  							xstatus.flags = CSSF_MASK_NAME|CSSF_DEFAULT_NAME|CSSF_UNICODE;
  							xstatus.ptszName = szDefaultName;
  							xstatus.wParam = &j;
 -							CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
 +							CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
  							tvis.item.pszText = szDefaultName;
  						}
  						tvis.item.lParam = (LPARAM)j;
 -						tvis.item.iImage = tvis.item.iSelectedImage = j?ImageList_AddIcon(hImageList, hIconAux=(HICON)CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSICON, (WPARAM)j, 0)):0;
 +						tvis.item.iImage = tvis.item.iSelectedImage = j?ImageList_AddIcon(hImageList, hIconAux=(HICON)CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSICON, (WPARAM)j, 0)):0;
  						if (hIconAux) DestroyIcon(hIconAux);
  						TreeView_InsertItem(hwndTree, &tvis);
  					}
  | 
