summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/crypt_icons.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
commit78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch)
tree8512c50df70b8dd80c919e88ade3419207c95956 /plugins/SecureIM/crypt_icons.cpp
parentce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff)
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SecureIM/crypt_icons.cpp')
-rw-r--r--plugins/SecureIM/crypt_icons.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/plugins/SecureIM/crypt_icons.cpp b/plugins/SecureIM/crypt_icons.cpp
index 97f86b43f8..5c3d21023d 100644
--- a/plugins/SecureIM/crypt_icons.cpp
+++ b/plugins/SecureIM/crypt_icons.cpp
@@ -17,9 +17,9 @@ HICON mode2icon(int mode,int type) {
int m=mode&0x0f,s=(mode&SECURED)>>4,i; // разобрали на части - режим и состояние
HICON icon;
- if( icons_cache ) {
+ if ( icons_cache ) {
for(i=0;i<icons_cache;i++) {
- if( ICONS_CACHE[i].mode == ((type<<8) | mode) ) {
+ if ( ICONS_CACHE[i].mode == ((type<<8) | mode) ) {
return ICONS_CACHE[i].icon;
}
}
@@ -32,7 +32,7 @@ HICON mode2icon(int mode,int type) {
case 3: i+=ICO_MW_DIS; break;
}
- if( type==1 ) {
+ if ( type==1 ) {
icon = BindOverlayIcon(g_hIEC[i],g_hICO[ICO_OV_NAT+m]);
}
else {
@@ -59,12 +59,12 @@ IconExtraColumn mode2iec(int mode) {
int m=mode&0x0f,s=(mode&SECURED)>>4; // разобрали на части - режим и состояние
- if( mode==-1 || (!s && !bASI && m!=MODE_PGP && m!=MODE_GPG) ) {
+ if ( mode==-1 || (!s && !bASI && m!=MODE_PGP && m!=MODE_GPG) ) {
return g_IEC[0]; // вернем пустое место
}
int i=1+m*IEC_CNT+IEC_CL_DIS+s;
- if( g_IEC[i].hImage==(HANDLE)-1 ) {
+ if ( g_IEC[i].hImage==(HANDLE)-1 ) {
/* g_hIEC[i] = mode2icon(mode,1);
g_IEC[i].hImage = (HANDLE) CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)g_hIEC[i], (LPARAM)0);*/
HICON icon = mode2icon(mode,1);
@@ -78,22 +78,22 @@ IconExtraColumn mode2iec(int mode) {
void ShowStatusIcon(HANDLE hContact,int mode) {
HANDLE hMC = getMetaContact(hContact);
- if( bADV || g_hCLIcon ) { // обновить иконки в clist
- if( mode!= -1 ) {
+ if ( bADV || g_hCLIcon ) { // обновить иконки в clist
+ if ( mode!= -1 ) {
IconExtraColumn iec=mode2iec(mode);
- if( g_hCLIcon ) {
+ if ( g_hCLIcon ) {
ExtraIcon_SetIcon(g_hCLIcon, hContact, iec.hImage);
- if( hMC )
+ if ( hMC )
ExtraIcon_SetIcon(g_hCLIcon, hMC, iec.hImage);
}
else {
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&iec);
- if( hMC )
+ if ( hMC )
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hMC, (LPARAM)&iec);
}
}
}
- if( ServiceExists(MS_MSG_MODIFYICON) ) { // обновить иконки в srmm
+ if ( ServiceExists(MS_MSG_MODIFYICON) ) { // обновить иконки в srmm
StatusIconData sid;
memset(&sid,0,sizeof(sid));
sid.cbSize = sizeof(sid);
@@ -101,10 +101,10 @@ void ShowStatusIcon(HANDLE hContact,int mode) {
for(int i=MODE_NATIVE; i<MODE_CNT;i++) {
sid.dwId = i;
sid.flags = (mode&SECURED)?0:MBF_DISABLED;
- if( mode==-1 || (mode&0x0f)!=i || isChatRoom(hContact) )
+ if ( mode==-1 || (mode&0x0f)!=i || isChatRoom(hContact) )
sid.flags |= MBF_HIDDEN; // отключаем все ненужные иконки
CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
- if( hMC )
+ if ( hMC )
CallService(MS_MSG_MODIFYICON, (WPARAM)hMC, (LPARAM)&sid);
}
}
@@ -127,20 +127,20 @@ void RefreshContactListIcons(void) {
HANDLE hContact;
// CallService(MS_CLUI_LISTBEGINREBUILD,0,0);
- if( !g_hCLIcon ) {
+ if ( !g_hCLIcon ) {
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) { // сначала все выключаем
ShowStatusIcon(hContact,-1);
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
// менем местоположение иконки
- for(int i=0;i<1+MODE_CNT*IEC_CNT;i++){
+ for(int i=0;i<1+MODE_CNT*IEC_CNT;i++) {
g_IEC[i].ColumnType = bADV;
}
}
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) { // и снова зажигаем иконку
- if( isSecureProtocol(hContact) )
+ if ( isSecureProtocol(hContact) )
ShowStatusIcon(hContact);
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}