summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src/cluiservices.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-26 22:28:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-26 22:28:47 +0000
commit7f47efb0c5973054e00fac918d2e1cdd187dd35a (patch)
treefa7adcd9166e58cd2ae2a15a2e744a5ea6b1b0b5 /plugins/Clist_nicer/src/cluiservices.cpp
parentc8ae2a45d384650fb562b078a06f024dc85caae8 (diff)
virtual protos, invisible in the Account Manager & status bar, but fortunately searchable
git-svn-id: http://svn.miranda-ng.org/main/trunk@2515 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src/cluiservices.cpp')
-rw-r--r--plugins/Clist_nicer/src/cluiservices.cpp29
1 files changed, 11 insertions, 18 deletions
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp
index 2d8c2e0db8..df7296080f 100644
--- a/plugins/Clist_nicer/src/cluiservices.cpp
+++ b/plugins/Clist_nicer/src/cluiservices.cpp
@@ -45,18 +45,16 @@ static INT_PTR GetClistVersion(WPARAM wParam, LPARAM lParam)
void FreeProtocolData( void )
{
//free protocol data
- int nPanel;
- int nParts=SendMessage(pcli->hwndStatus,SB_GETPARTS,0,0);
- for (nPanel=0;nPanel<nParts;nPanel++)
- {
- ProtocolData *PD;
- PD=(ProtocolData *)SendMessage(pcli->hwndStatus,SB_GETTEXT,(WPARAM)nPanel,0);
- if (PD!=NULL&&!IsBadCodePtr((FARPROC)PD))
- {
+ int nParts = SendMessage(pcli->hwndStatus,SB_GETPARTS,0,0);
+ for (int nPanel=0; nPanel < nParts; nPanel++) {
+ ProtocolData *PD = (ProtocolData *)SendMessage(pcli->hwndStatus, SB_GETTEXT, nPanel, 0);
+ if (PD != NULL && !IsBadCodePtr((FARPROC)PD)) {
SendMessage(pcli->hwndStatus,SB_SETTEXT,(WPARAM)nPanel|SBT_OWNERDRAW,0);
if (PD->RealName) mir_free(PD->RealName);
if (PD) mir_free(PD);
-} } }
+ }
+ }
+}
int g_maxStatus = ID_STATUS_OFFLINE;
char g_maxProto[100] = "";
@@ -173,20 +171,16 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
SendMessage(pcli->hwndStatus, SB_SETPARTS, partCount, (LPARAM)partWidths);
for ( partCount=0, i=0; i < protoCount; i++ ) { //count down since built in ones tend to go at the end
- ProtocolData *PD;
- PROTOACCOUNT *pa;
- int caps1, caps2;
-
int idx = pcli->pfnGetAccountIndexByPos( i );
if ( idx == -1 )
continue;
- pa = accs[idx];
+ PROTOACCOUNT *pa = accs[idx];
if ( !pcli->pfnGetProtocolVisibility( pa->szModuleName ))
continue;
status = CallProtoService( pa->szModuleName,PS_GETSTATUS,0,0);
- PD = ( ProtocolData* )mir_alloc(sizeof(ProtocolData));
+ ProtocolData *PD = ( ProtocolData* )mir_alloc(sizeof(ProtocolData));
PD->RealName = mir_strdup( pa->szModuleName );
PD->statusbarpos = partCount;
{
@@ -196,8 +190,8 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
flags |= SBT_NOBORDERS;
SendMessageA( pcli->hwndStatus, SB_SETTEXTA, partCount|flags,(LPARAM)PD );
}
- caps2 = CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0);
- caps1 = CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
+ int caps2 = CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0);
+ int caps1 = CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if ((caps1 & PF1_IM) && (caps2 & (PF2_LONGAWAY | PF2_SHORTAWAY))) {
onlineness = GetStatusOnlineness(status);
if (onlineness > maxOnline) {
@@ -262,5 +256,4 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
}
SFL_Update(hIcon, iIcon, hCListImages, szStatus, TRUE);
}
- return;
}