summaryrefslogtreecommitdiff
path: root/protocols/AimOscar
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 /protocols/AimOscar
parentce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff)
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar')
-rw-r--r--protocols/AimOscar/connection.cpp50
-rw-r--r--protocols/AimOscar/conv.cpp12
-rw-r--r--protocols/AimOscar/links.cpp2
-rw-r--r--protocols/AimOscar/server.cpp10
-rw-r--r--protocols/AimOscar/services.cpp2
-rw-r--r--protocols/AimOscar/theme.cpp4
-rw-r--r--protocols/AimOscar/ui.cpp12
-rw-r--r--protocols/AimOscar/utility.cpp2
8 files changed, 47 insertions, 47 deletions
diff --git a/protocols/AimOscar/connection.cpp b/protocols/AimOscar/connection.cpp
index 79c1e7c41d..81548f875b 100644
--- a/protocols/AimOscar/connection.cpp
+++ b/protocols/AimOscar/connection.cpp
@@ -102,7 +102,7 @@ void CAimProto::aim_connection_authorization(void)
hServerPacketRecver = (HANDLE)CallService(MS_NETLIB_CREATEPACKETRECVER, (WPARAM)hServerConn, 2048 * 4);
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = 5000;
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM) hServerPacketRecver, (LPARAM) & packetRecv);
if (recvResult == 0)
@@ -118,12 +118,12 @@ void CAimProto::aim_connection_authorization(void)
else
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],(unsigned short)(packetRecv.bytesAvailable-packetRecv.bytesUsed));
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if (flap.cmp(0x01))
@@ -180,7 +180,7 @@ void __cdecl CAimProto::aim_protocol_negotiation( void* )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = DEFAULT_KEEPALIVE_TIMER*1000;
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM)hServerPacketRecver, (LPARAM)&packetRecv);
if (recvResult == 0)
@@ -204,12 +204,12 @@ void __cdecl CAimProto::aim_protocol_negotiation( void* )
else if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
@@ -314,12 +314,12 @@ void __cdecl CAimProto::aim_mail_negotiation( void* )
if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
@@ -364,7 +364,7 @@ void __cdecl CAimProto::aim_avatar_negotiation( void* )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = 300000;//5 minutes connected
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM) hServerPacketRecver, (LPARAM) & packetRecv);
if (recvResult == 0)
@@ -376,7 +376,7 @@ void __cdecl CAimProto::aim_avatar_negotiation( void* )
if (recvResult > 0)
{
unsigned short flap_length=0;
- for(; packetRecv.bytesUsed < packetRecv.bytesAvailable; packetRecv.bytesUsed = flap_length)
+ for (; packetRecv.bytesUsed < packetRecv.bytesAvailable; packetRecv.bytesUsed = flap_length)
{
if (!packetRecv.buffer)
break;
@@ -429,7 +429,7 @@ void __cdecl CAimProto::aim_chatnav_negotiation( void* )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = DEFAULT_KEEPALIVE_TIMER*1000;
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM) hServerPacketRecver, (LPARAM)&packetRecv);
if (recvResult == 0)
@@ -454,12 +454,12 @@ void __cdecl CAimProto::aim_chatnav_negotiation( void* )
if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
@@ -507,7 +507,7 @@ void __cdecl CAimProto::aim_chat_negotiation( void* param )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = DEFAULT_KEEPALIVE_TIMER*1000;
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM)hServerPacketRecver, (LPARAM)&packetRecv);
if (recvResult == 0)
@@ -527,12 +527,12 @@ void __cdecl CAimProto::aim_chat_negotiation( void* param )
if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
@@ -581,7 +581,7 @@ void __cdecl CAimProto::aim_admin_negotiation( void* )
NETLIBPACKETRECVER packetRecv = {0};
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = 300000;//5 minutes connected
- for(;;)
+ for (;;)
{
int recvResult = CallService(MS_NETLIB_GETMOREPACKETS, (WPARAM) hServerPacketRecver, (LPARAM) & packetRecv);
if (recvResult == 0)
@@ -593,12 +593,12 @@ void __cdecl CAimProto::aim_admin_negotiation( void* )
if(recvResult>0)
{
unsigned short flap_length=0;
- for(;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
+ for (;packetRecv.bytesUsed<packetRecv.bytesAvailable;packetRecv.bytesUsed=flap_length)
{
- if(!packetRecv.buffer)
+ if (!packetRecv.buffer)
break;
FLAP flap((char*)&packetRecv.buffer[packetRecv.bytesUsed],packetRecv.bytesAvailable-packetRecv.bytesUsed);
- if(!flap.len())
+ if (!flap.len())
break;
flap_length+=FLAP_SIZE+flap.len();
if(flap.cmp(0x01))
diff --git a/protocols/AimOscar/conv.cpp b/protocols/AimOscar/conv.cpp
index 416363c096..ebe531876f 100644
--- a/protocols/AimOscar/conv.cpp
+++ b/protocols/AimOscar/conv.cpp
@@ -202,7 +202,7 @@ char* html_to_bbcodes(char *src)
*ptr = '[';
*(ptr+1) = 'b';
*(ptr+2) = ']';
- if((ptr = strstr(dest, "</B>")) != NULL || (ptr = strstr(dest, "</b>")) != NULL)
+ if ((ptr = strstr(dest, "</B>")) != NULL || (ptr = strstr(dest, "</b>")) != NULL)
{
*ptr = '[';
*(ptr+2) = 'b';
@@ -219,7 +219,7 @@ char* html_to_bbcodes(char *src)
*ptr = '[';
*(ptr+1) = 'i';
*(ptr+2) = ']';
- if((ptr = strstr(dest, "</I>")) != NULL || (ptr = strstr(dest, "</i>")) != NULL)
+ if ((ptr = strstr(dest, "</I>")) != NULL || (ptr = strstr(dest, "</i>")) != NULL)
{
*ptr = '[';
*(ptr+2) = 'i';
@@ -236,7 +236,7 @@ char* html_to_bbcodes(char *src)
*ptr = '[';
*(ptr+1) = 'u';
*(ptr+2) = ']';
- if((ptr = strstr(dest, "</U>")) != NULL || (ptr = strstr(dest, "</u>")) != NULL)
+ if ((ptr = strstr(dest, "</U>")) != NULL || (ptr = strstr(dest, "</u>")) != NULL)
{
*ptr = '[';
*(ptr+2) = 'u';
@@ -253,7 +253,7 @@ char* html_to_bbcodes(char *src)
*ptr = '[';
*(ptr+1) = 's';
*(ptr+2) = ']';
- if((ptr = strstr(dest, "</S>")) != NULL || (ptr = strstr(dest, "</s>")) != NULL)
+ if ((ptr = strstr(dest, "</S>")) != NULL || (ptr = strstr(dest, "</s>")) != NULL)
{
*ptr = '[';
*(ptr+2) = 's';
@@ -718,7 +718,7 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem)
pos+=strlen(Face);
strcpy(&buf[pos],"\"");
pos++;
- if(!(cfOld.dwEffects & CFE_AUTOBACKCOLOR))
+ if (!(cfOld.dwEffects & CFE_AUTOBACKCOLOR))
{
strcpy(&buf[pos]," back=#");
pos+=6;
@@ -734,7 +734,7 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem)
strcpy(&buf[pos],chBackColor);
pos+=6;
}
- if(!(cfOld.dwEffects & CFE_AUTOCOLOR))
+ if (!(cfOld.dwEffects & CFE_AUTOCOLOR))
{
strcpy(&buf[pos]," color=#");
pos+=8;
diff --git a/protocols/AimOscar/links.cpp b/protocols/AimOscar/links.cpp
index 42cbc25cf1..c4eec4ae69 100644
--- a/protocols/AimOscar/links.cpp
+++ b/protocols/AimOscar/links.cpp
@@ -147,7 +147,7 @@ static INT_PTR ServiceParseAimLink(WPARAM /*wParam*/,LPARAM lParam)
return 0;
}
/* open a chatroom */
- else if(!_tcsnicmp(arg, _T("gochat?"), 7))
+ else if (!_tcsnicmp(arg, _T("gochat?"), 7))
{
TCHAR *tok, *tok2;
char *rm = NULL;
diff --git a/protocols/AimOscar/server.cpp b/protocols/AimOscar/server.cpp
index 3ff1ecff89..490444303b 100644
--- a/protocols/AimOscar/server.cpp
+++ b/protocols/AimOscar/server.cpp
@@ -467,7 +467,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003
}
if(f002&&f003&&f004&&f005)
strcpy(client,CLIENT_TRILLIAN_PRO);
- else if((f004&&f005&&f007&&f008) || (f004&&f005&&O104&&O105))
+ else if ((f004&&f005&&f007&&f008) || (f004&&f005&&O104&&O105))
strcpy(client,CLIENT_ICHAT);
else if(f003&f004&f005)
strcpy(client,CLIENT_TRILLIAN);
@@ -1647,7 +1647,7 @@ void CAimProto::snac_received_info(SNAC &snac)//family 0x0002
write_away_message(sn,Translate("No information has been provided by the server."),false);
request_away_message = 0;
}
- if(!profile_received&&request_HTML_profile)
+ if (!profile_received&&request_HTML_profile)
write_profile(sn,"No Profile",false);
request_HTML_profile=0;
}
@@ -2387,11 +2387,11 @@ void CAimProto::snac_admin_account_confirm(SNAC &snac)//family 0x0007
{
unsigned short* type=(unsigned short*)&buf[SNAC_SIZE*2+1+sn_length];
*type=htons(*type);
- if(*type==0x0000)//typing finished
+ if (*type==0x0000)//typing finished
CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)hContact,(WPARAM)PROTOTYPE_CONTACTTYPING_OFF);
- else if(*type==0x0001)//typed
+ else if (*type==0x0001)//typed
CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)hContact,PROTOTYPE_CONTACTTYPING_INFINITE);
- else if(*type==0x0002)//typing
+ else if (*type==0x0002)//typing
CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)hContact,(LPARAM)60);
}
}
diff --git a/protocols/AimOscar/services.cpp b/protocols/AimOscar/services.cpp
index d50c455013..caf2209560 100644
--- a/protocols/AimOscar/services.cpp
+++ b/protocols/AimOscar/services.cpp
@@ -127,7 +127,7 @@ int CAimProto::OnDbSettingChanged(WPARAM wParam,LPARAM lParam)
if (cws->value.type == DBVT_DELETED)
{
DBVARIANT dbv;
- if(!DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
+ if (!DBGetContactSettingStringUtf(hContact, MOD_KEY_CL, OTH_KEY_GP, &dbv) && dbv.pszVal[0])
{
add_contact_to_group(hContact, dbv.pszVal);
DBFreeVariant(&dbv);
diff --git a/protocols/AimOscar/theme.cpp b/protocols/AimOscar/theme.cpp
index 04a928887a..315fd1d0e4 100644
--- a/protocols/AimOscar/theme.cpp
+++ b/protocols/AimOscar/theme.cpp
@@ -282,7 +282,7 @@ static int OnExtraIconsApply(WPARAM wParam, LPARAM /*lParam*/)
void remove_AT_icons(CAimProto* ppro)
{
- if(!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
+ if (!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact)
@@ -296,7 +296,7 @@ void remove_AT_icons(CAimProto* ppro)
void remove_ES_icons(CAimProto* ppro)
{
- if(!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
+ if (!ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) return;
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact)
diff --git a/protocols/AimOscar/ui.cpp b/protocols/AimOscar/ui.cpp
index 2bfee72319..d365d910ae 100644
--- a/protocols/AimOscar/ui.cpp
+++ b/protocols/AimOscar/ui.cpp
@@ -254,7 +254,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
SendDlgItemMessage(hwndDlg, IDC_PROFILE, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cfOld);
BOOL isSub = (cfOld.dwEffects & CFE_SUBSCRIPT) && (cfOld.dwMask & CFM_SUBSCRIPT);
BOOL isSuper = (cfOld.dwEffects & CFE_SUPERSCRIPT) && (cfOld.dwMask & CFM_SUPERSCRIPT);
- if(!isSub&&!isSuper)
+ if (!isSub&&!isSuper)
{
DrawMyControl(lpDIS->hDC,GetDlgItem(hwndDlg, IDC_BOLD),hThemeButton,lpDIS->itemState|ODS_SELECTED, lpDIS->rcItem);
DrawIconEx(lpDIS->hDC, 4, 5, LoadIconEx("norm_scrpt"), 16, 16, 0, 0, DI_NORMAL);
@@ -314,7 +314,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
cfOld.dwMask = CFM_ITALIC;
SendDlgItemMessage(hwndDlg, IDC_PROFILE, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cfOld);
BOOL isItalic = (cfOld.dwEffects & CFE_ITALIC) && (cfOld.dwMask & CFM_ITALIC);
- if(!isItalic)
+ if (!isItalic)
{
DrawMyControl(lpDIS->hDC,GetDlgItem(hwndDlg, IDC_ITALIC),hThemeButton,lpDIS->itemState, lpDIS->rcItem);
DrawIconEx(lpDIS->hDC, 4, 5, LoadIconEx("nitalic"), 16, 16, 0, 0, DI_NORMAL);
@@ -334,7 +334,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
cfOld.dwMask = CFM_UNDERLINE;
SendDlgItemMessage(hwndDlg, IDC_PROFILE, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cfOld);
BOOL isUnderline = (cfOld.dwEffects & CFE_UNDERLINE) && (cfOld.dwMask & CFM_UNDERLINE);
- if(!isUnderline)
+ if (!isUnderline)
{
DrawMyControl(lpDIS->hDC,GetDlgItem(hwndDlg, IDC_UNDERLINE),hThemeButton,lpDIS->itemState, lpDIS->rcItem);
DrawIconEx(lpDIS->hDC, 4, 5, LoadIconEx("nundrln"), 16, 16, 0, 0, DI_NORMAL);
@@ -945,7 +945,7 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (IsDlgButtonChecked(hwndDlg, IDC_AT))
{
int acc_disabled = ppro->getByte(AIM_KEY_AT, 0);
- if(!acc_disabled)
+ if (!acc_disabled)
remove_AT_icons(ppro);
ppro->setByte(AIM_KEY_AT, 1);
}
@@ -962,7 +962,7 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
int es_disabled = ppro->getByte(AIM_KEY_ES, 0);
ppro->setByte(AIM_KEY_ES, 1);
- if(!es_disabled)
+ if (!es_disabled)
remove_ES_icons(ppro);
}
else
@@ -978,7 +978,7 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (IsDlgButtonChecked(hwndDlg, IDC_HF))
{
int hf = ppro->getByte(AIM_KEY_HF, 0);
- if(!hf)
+ if (!hf)
ShowWindow(GetDlgItem(hwndDlg, IDC_MASQ), SW_SHOW);
ppro->setByte(AIM_KEY_HF, 1);
}
diff --git a/protocols/AimOscar/utility.cpp b/protocols/AimOscar/utility.cpp
index 4867ec0678..dfa18843ad 100644
--- a/protocols/AimOscar/utility.cpp
+++ b/protocols/AimOscar/utility.cpp
@@ -108,7 +108,7 @@ void CAimProto::start_connection(void *arg)
broadcast_status(ID_STATUS_OFFLINE);
return;
}
- if(!getString(AIM_KEY_PW, &dbv))
+ if (!getString(AIM_KEY_PW, &dbv))
DBFreeVariant(&dbv);
else
{