summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-02-12 20:44:55 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-02-12 20:44:55 +0000
commit82016434fff2eb8ed8288c0c45bc76a67574860d (patch)
treef0771b2391899c61960c27af13d5e046f0d087d2 /plugins
parentc989c00ce9e0a8422e7efb3c21350ca3f5276d86 (diff)
- fix for chinese in popups;
- own md5 module removed; - version bump; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@3585 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/YAMN/YAMN_10.vcxproj1
-rw-r--r--plugins/YAMN/YAMN_10.vcxproj.filters3
-rw-r--r--plugins/YAMN/YAMN_11.vcxproj1
-rw-r--r--plugins/YAMN/YAMN_11.vcxproj.filters3
-rw-r--r--plugins/YAMN/src/account.cpp82
-rw-r--r--plugins/YAMN/src/browser/badconnect.cpp34
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp198
-rw-r--r--plugins/YAMN/src/filterplugin.cpp20
-rw-r--r--plugins/YAMN/src/mails/decode.cpp20
-rw-r--r--plugins/YAMN/src/mails/mails.cpp58
-rw-r--r--plugins/YAMN/src/mails/mime.cpp112
-rw-r--r--plugins/YAMN/src/main.cpp6
-rw-r--r--plugins/YAMN/src/proto/md5.c259
-rw-r--r--plugins/YAMN/src/proto/md5.h27
-rw-r--r--plugins/YAMN/src/proto/netlib.cpp2
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3.cpp20
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3.h2
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3comm.cpp146
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3opt.cpp46
-rw-r--r--plugins/YAMN/src/protoplugin.cpp18
-rw-r--r--plugins/YAMN/src/synchro.cpp24
-rw-r--r--plugins/YAMN/src/version.h6
-rw-r--r--plugins/YAMN/src/yamn.cpp16
23 files changed, 401 insertions, 703 deletions
diff --git a/plugins/YAMN/YAMN_10.vcxproj b/plugins/YAMN/YAMN_10.vcxproj
index a9479b4d2d..a201f6041f 100644
--- a/plugins/YAMN/YAMN_10.vcxproj
+++ b/plugins/YAMN/YAMN_10.vcxproj
@@ -191,7 +191,6 @@
<ClCompile Include="src\mails\decode.cpp" />
<ClCompile Include="src\mails\mails.cpp" />
<ClCompile Include="src\mails\mime.cpp" />
- <ClCompile Include="src\proto\md5.c" />
<ClCompile Include="src\proto\netlib.cpp" />
<ClCompile Include="src\proto\pop3\pop3.cpp" />
<ClCompile Include="src\proto\pop3\pop3comm.cpp" />
diff --git a/plugins/YAMN/YAMN_10.vcxproj.filters b/plugins/YAMN/YAMN_10.vcxproj.filters
index 5a21b2d9db..a9629779da 100644
--- a/plugins/YAMN/YAMN_10.vcxproj.filters
+++ b/plugins/YAMN/YAMN_10.vcxproj.filters
@@ -62,9 +62,6 @@
<ClCompile Include="src\mails\mime.cpp">
<Filter>Source Files\Mails</Filter>
</ClCompile>
- <ClCompile Include="src\proto\md5.c">
- <Filter>Source Files\POP3 plugin</Filter>
- </ClCompile>
<ClCompile Include="src\proto\netlib.cpp">
<Filter>Source Files\POP3 plugin</Filter>
</ClCompile>
diff --git a/plugins/YAMN/YAMN_11.vcxproj b/plugins/YAMN/YAMN_11.vcxproj
index 6cc7036a4e..1997bdbf3b 100644
--- a/plugins/YAMN/YAMN_11.vcxproj
+++ b/plugins/YAMN/YAMN_11.vcxproj
@@ -195,7 +195,6 @@
<ClCompile Include="src\mails\decode.cpp" />
<ClCompile Include="src\mails\mails.cpp" />
<ClCompile Include="src\mails\mime.cpp" />
- <ClCompile Include="src\proto\md5.c" />
<ClCompile Include="src\proto\netlib.cpp" />
<ClCompile Include="src\proto\pop3\pop3.cpp" />
<ClCompile Include="src\proto\pop3\pop3comm.cpp" />
diff --git a/plugins/YAMN/YAMN_11.vcxproj.filters b/plugins/YAMN/YAMN_11.vcxproj.filters
index 5a21b2d9db..a9629779da 100644
--- a/plugins/YAMN/YAMN_11.vcxproj.filters
+++ b/plugins/YAMN/YAMN_11.vcxproj.filters
@@ -62,9 +62,6 @@
<ClCompile Include="src\mails\mime.cpp">
<Filter>Source Files\Mails</Filter>
</ClCompile>
- <ClCompile Include="src\proto\md5.c">
- <Filter>Source Files\POP3 plugin</Filter>
- </ClCompile>
<ClCompile Include="src\proto\netlib.cpp">
<Filter>Source Files\POP3 plugin</Filter>
</ClCompile>
diff --git a/plugins/YAMN/src/account.cpp b/plugins/YAMN/src/account.cpp
index f45dcfadcd..76b653a4b7 100644
--- a/plugins/YAMN/src/account.cpp
+++ b/plugins/YAMN/src/account.cpp
@@ -48,12 +48,12 @@ INT_PTR CreatePluginAccountSvc(WPARAM wParam,LPARAM lParam)
HACCOUNT NewAccount;
//test if we are going to initialize members of suitable structure (structures of plugin and YAMN must match)
- if (AccountVersion!=YAMN_ACCOUNTVERSION)
+ if (AccountVersion != YAMN_ACCOUNTVERSION)
return NULL;
- if (Plugin!=NULL)
+ if (Plugin != NULL)
{
- if (Plugin->Fcn->NewAccountFcnPtr!=NULL)
+ if (Plugin->Fcn->NewAccountFcnPtr != NULL)
{
//Let plugin create its own structure, which can be derived from CAccount structure
NewAccount=Plugin->Fcn->NewAccountFcnPtr(Plugin,YAMN_ACCOUNTVERSION);
@@ -80,11 +80,11 @@ INT_PTR DeletePluginAccountSvc(WPARAM wParam,LPARAM)
{
HACCOUNT OldAccount=(HACCOUNT)wParam;
- if (OldAccount->Plugin->Fcn!=NULL)
+ if (OldAccount->Plugin->Fcn != NULL)
{
//Deinit every members and allocated fields of structure used by YAMN
DeInitAccount(OldAccount);
- if (OldAccount->Plugin->Fcn->DeleteAccountFcnPtr!=NULL)
+ if (OldAccount->Plugin->Fcn->DeleteAccountFcnPtr != NULL)
{
//Let plugin delete its own CAccount derived structure
OldAccount->Plugin->Fcn->DeleteAccountFcnPtr(OldAccount);
@@ -134,15 +134,15 @@ int InitAccount(HACCOUNT Which)
void DeInitAccount(HACCOUNT Which)
{
//delete YAMN allocated fields
- if (Which->Name!=NULL)
+ if (Which->Name != NULL)
delete[] Which->Name;
- if (Which->Server->Name!=NULL)
+ if (Which->Server->Name != NULL)
delete[] Which->Server->Name;
- if (Which->Server->Login!=NULL)
+ if (Which->Server->Login != NULL)
delete[] Which->Server->Login;
- if (Which->Server->Passwd!=NULL)
+ if (Which->Server->Passwd != NULL)
delete[] Which->Server->Passwd;
- if (Which->Server!=NULL)
+ if (Which->Server != NULL)
delete[] Which->Server;
SWMRGDelete(Which->AccountAccessSO);
@@ -173,7 +173,7 @@ void CodeDecodeString(char *Dest,BOOL Encrypt)
if (Dest==NULL)
return;
- for (;*Dest!=(TCHAR)0;Dest++)
+ for (;*Dest != (TCHAR)0;Dest++)
{
if (Encrypt)
*Dest=*Dest+Code;
@@ -229,7 +229,7 @@ DWORD ReadStringFromMemory(char **Parser,TCHAR *End,char **StoreTo,TCHAR *DebugS
TCHAR Debug[65536];
Finder=*Parser;
- while((*Finder!=(TCHAR)0) && (Finder<=End)) Finder++;
+ while((*Finder != (TCHAR)0) && (Finder<=End)) Finder++;
_stprintf(Debug,_T("%s: %s,length is %d, remaining %d chars"),DebugString,*Parser,Finder-*Parser,End-Finder);
MessageBox(NULL,Debug,_T("debug"),MB_OK);
if (Finder>=End)
@@ -256,7 +256,7 @@ DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo)
DWORD Size;
Finder=*Parser;
- while((*Finder!=(TCHAR)0) && (Finder<=End)) Finder++;
+ while((*Finder != (TCHAR)0) && (Finder<=End)) Finder++;
if (Finder>=End)
return EACC_FILECOMPATIBILITY;
if (Size=Finder-*Parser)
@@ -284,7 +284,7 @@ DWORD ReadStringFromMemoryW(WCHAR **Parser,TCHAR *End,WCHAR **StoreTo,WCHAR *Deb
WCHAR Debug[65536];
Finder=*Parser;
- while((*Finder!=(WCHAR)0) && (Finder<=(WCHAR *)End)) Finder++;
+ while((*Finder != (WCHAR)0) && (Finder<=(WCHAR *)End)) Finder++;
swprintf(Debug,L"%s: %s,length is %d, remaining %d chars",DebugString,*Parser,Finder-*Parser,(WCHAR *)End-Finder);
MessageBoxW(NULL,Debug,L"debug",MB_OK);
if (Finder>=(WCHAR *)End)
@@ -311,7 +311,7 @@ DWORD ReadStringFromMemoryW(WCHAR **Parser,WCHAR *End,WCHAR **StoreTo)
DWORD Size;
Finder=*Parser;
- while((*Finder!=(WCHAR)0) && (Finder<=(WCHAR *)End)) Finder++;
+ while((*Finder != (WCHAR)0) && (Finder<=(WCHAR *)End)) Finder++;
if (Finder>=(WCHAR *)End)
return EACC_FILECOMPATIBILITY;
if (Size=Finder-*Parser)
@@ -399,7 +399,7 @@ DWORD ReadMessagesFromMemory(HACCOUNT Which,char **Parser,char *End)
do
{
Finder=*Parser;
- while((*Finder!=(TCHAR)0) && (Finder<=End)) Finder++;
+ while((*Finder != (TCHAR)0) && (Finder<=End)) Finder++;
if (Finder>=End)
return EACC_FILECOMPATIBILITY;
if (Size=Finder-*Parser)
@@ -438,7 +438,7 @@ DWORD ReadMessagesFromMemory(HACCOUNT Which,char **Parser,char *End)
if (*Parser>=End)
return EACC_FILECOMPATIBILITY;
- if ((NULL!=Which->Plugin->MailFcn) && (NULL!=Which->Plugin->MailFcn->ReadMailOptsFcnPtr))
+ if ((NULL != Which->Plugin->MailFcn) && (NULL != Which->Plugin->MailFcn->ReadMailOptsFcnPtr))
Which->Plugin->MailFcn->ReadMailOptsFcnPtr(ActualMail,Parser,End); //read plugin mail settings from file
do
@@ -575,7 +575,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which,char **Parser,char *End)
return Stat;
//Let plugin read its own data stored in file
- if (Which->Plugin->Fcn!=NULL && Which->Plugin->Fcn->ReadPluginOptsFcnPtr!=NULL)
+ if (Which->Plugin->Fcn != NULL && Which->Plugin->Fcn->ReadPluginOptsFcnPtr != NULL)
if (Stat=Which->Plugin->Fcn->ReadPluginOptsFcnPtr(Which,Parser,End))
return Stat;
//Read mails
@@ -688,9 +688,9 @@ static INT_PTR PerformAccountReading(HYAMNPROTOPLUGIN Plugin,char *MemFile,char
if (ActualAccount->StatusFlags & (YAMN_ACC_STARTA | YAMN_ACC_STARTS))
ActualAccount->TimeLeft=1; //check on loading
- if (Stat && (Stat!=EACC_ENDOFFILE))
+ if (Stat && (Stat != EACC_ENDOFFILE))
{
- for (ActualAccount=FirstAllocatedAccount;ActualAccount!=NULL;ActualAccount=Temp)
+ for (ActualAccount=FirstAllocatedAccount;ActualAccount != NULL;ActualAccount=Temp)
{
Temp=ActualAccount->Next;
delete ActualAccount;
@@ -710,9 +710,9 @@ static INT_PTR PerformAccountReading(HYAMNPROTOPLUGIN Plugin,char *MemFile,char
#endif
WriteDoneFcn(ActualAccount->AccountAccessSO);
- if ((Stat!=EACC_ENDOFFILE) && (NULL==(ActualAccount=(HACCOUNT)CallService(MS_YAMN_GETNEXTFREEACCOUNT,(WPARAM)Plugin,(LPARAM)YAMN_ACCOUNTVERSION))))
+ if ((Stat != EACC_ENDOFFILE) && (NULL==(ActualAccount=(HACCOUNT)CallService(MS_YAMN_GETNEXTFREEACCOUNT,(WPARAM)Plugin,(LPARAM)YAMN_ACCOUNTVERSION))))
{
- for (ActualAccount=FirstAllocatedAccount;ActualAccount!=NULL;ActualAccount=Temp)
+ for (ActualAccount=FirstAllocatedAccount;ActualAccount != NULL;ActualAccount=Temp)
{
Temp=ActualAccount->Next;
delete ActualAccount;
@@ -726,7 +726,7 @@ static INT_PTR PerformAccountReading(HYAMNPROTOPLUGIN Plugin,char *MemFile,char
SWMRGDoneWriting(Plugin->AccountBrowserSO);
return EACC_ALLOC;
}
- }while(Stat!=EACC_ENDOFFILE);
+ }while(Stat != EACC_ENDOFFILE);
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"AddAccountsFromFile:AccountBrowserSO-write done\n");
@@ -790,7 +790,7 @@ DWORD WriteMessagesToFile(HANDLE File,HACCOUNT Which)
HYAMNMAIL ActualMail=(HYAMNMAIL)Which->Mails;
struct CMimeItem *items;
- while(ActualMail!=NULL)
+ while(ActualMail != NULL)
{
if (Stat=WriteStringToFile(File,ActualMail->ID))
return Stat;
@@ -798,9 +798,9 @@ DWORD WriteMessagesToFile(HANDLE File,HACCOUNT Which)
!WriteFile(File,(char *)&ActualMail->Flags,sizeof(ActualMail->Flags),&WrittenBytes,NULL) ||
!WriteFile(File,(char *)&ActualMail->Number,sizeof(ActualMail->Number),&WrittenBytes,NULL))
return EACC_SYSTEM;
- if ((NULL!=Which->Plugin->MailFcn) && (NULL!=Which->Plugin->MailFcn->WriteMailOptsFcnPtr))
+ if ((NULL != Which->Plugin->MailFcn) && (NULL != Which->Plugin->MailFcn->WriteMailOptsFcnPtr))
Which->Plugin->MailFcn->WriteMailOptsFcnPtr(File,ActualMail); //write plugin mail options to file
- for (items=ActualMail->MailData->TranslatedHeader;items!=NULL;items=items->Next)
+ for (items=ActualMail->MailData->TranslatedHeader;items != NULL;items=items->Next)
{
if (Stat=WriteStringToFile(File,items->name))
return Stat;
@@ -833,7 +833,7 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin,HANDLE File)
#endif
try
{
- for (ActualAccount=Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=ActualAccount->Next)
+ for (ActualAccount=Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=ActualAccount->Next)
{
/* TCHAR DEBUG[100];
Beep(3000,100);Sleep(200);
@@ -930,7 +930,7 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin,HANDLE File)
throw (DWORD)Stat;
//Let plugin write its own values into file
- if (ActualAccount->Plugin->Fcn!=NULL && ActualAccount->Plugin->Fcn->WritePluginOptsFcnPtr!=NULL)
+ if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->WritePluginOptsFcnPtr != NULL)
if (Stat=ActualAccount->Plugin->Fcn->WritePluginOptsFcnPtr(File,ActualAccount))
throw (DWORD)Stat;
#ifdef DEBUG_SYNCHRO
@@ -1013,8 +1013,8 @@ INT_PTR FindAccountByNameSvc(WPARAM wParam,LPARAM lParam)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"FindAccountByName:AccountBrowserSO-read enter\n");
#endif
- for (Finder=Plugin->FirstAccount;Finder!=NULL;Finder=Finder->Next)
- if ((Finder->Name!=NULL) && (0 == strcmp(SearchedAccount,Finder->Name)))
+ for (Finder=Plugin->FirstAccount;Finder != NULL;Finder=Finder->Next)
+ if ((Finder->Name != NULL) && (0 == strcmp(SearchedAccount,Finder->Name)))
break;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"FindAccountByName:AccountBrowserSO-read done\n");
@@ -1033,7 +1033,7 @@ INT_PTR GetNextFreeAccountSvc(WPARAM wParam,LPARAM lParam)
Plugin->FirstAccount=(HACCOUNT)CallService(MS_YAMN_CREATEPLUGINACCOUNT,wParam,lParam);
return (INT_PTR)Plugin->FirstAccount;
}
- for (Finder=Plugin->FirstAccount;Finder->Next!=NULL;Finder=Finder->Next);
+ for (Finder=Plugin->FirstAccount;Finder->Next != NULL;Finder=Finder->Next);
Finder->Next=(HACCOUNT)CallService(MS_YAMN_CREATEPLUGINACCOUNT,wParam,lParam);
return (INT_PTR)Finder->Next;
}
@@ -1046,7 +1046,7 @@ int FindPluginAccount(WPARAM wParam,LPARAM lParam)
if (Finder=NULL) Finder=Plugin->FirstAccount;
-// for (;Finder!=NULL && Finder->PluginID!=Plugin->PluginInfo->PluginID;Finder=(HACCOUNT)Finder->Next);
+// for (;Finder != NULL && Finder->PluginID != Plugin->PluginInfo->PluginID;Finder=(HACCOUNT)Finder->Next);
return (int)Finder;
}
*/
@@ -1085,7 +1085,7 @@ INT_PTR DeleteAccountSvc(WPARAM wParam,LPARAM lParam)
//1. set stop signal
StopSignalFcn(Which);
WindowList_BroadcastAsync(YAMNVar.MessageWnds,WM_YAMN_STOPACCOUNT,(WPARAM)Which,0);
- if (Plugin->Fcn->StopAccountFcnPtr!=NULL)
+ if (Plugin->Fcn->StopAccountFcnPtr != NULL)
Plugin->Fcn->StopAccountFcnPtr(Which);
//2. wait to get write access
@@ -1113,7 +1113,7 @@ INT_PTR DeleteAccountSvc(WPARAM wParam,LPARAM lParam)
}
else
{
- for (Finder=Plugin->FirstAccount;Which!=Finder->Next;Finder=Finder->Next);
+ for (Finder=Plugin->FirstAccount;Which != Finder->Next;Finder=Finder->Next);
Finder->Next=Finder->Next->Next;
}
//leave write access
@@ -1128,7 +1128,7 @@ INT_PTR DeleteAccountSvc(WPARAM wParam,LPARAM lParam)
// No, of course not. We will create new thread, that will wait and additionally remove our thread in background.
//5. So, the last point (deleting from memory) is performed in new DeleteAccountInBackground thread
- if ((Plugin->Fcn!=NULL) && (Plugin->Fcn->WriteAccountsFcnPtr!=NULL))
+ if ((Plugin->Fcn != NULL) && (Plugin->Fcn->WriteAccountsFcnPtr != NULL))
Plugin->Fcn->WriteAccountsFcnPtr();
CloseHandle(CreateThread(NULL,0,DeleteAccountInBackground,(LPVOID)Which,0,&tid));
@@ -1157,12 +1157,12 @@ int StopAccounts(HYAMNPROTOPLUGIN Plugin)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"StopAccounts:AccountBrowserSO-write enter\n");
#endif
- for (Finder=Plugin->FirstAccount;Finder!=NULL;Finder=Finder->Next)
+ for (Finder=Plugin->FirstAccount;Finder != NULL;Finder=Finder->Next)
{
//2. set stop signal
StopSignalFcn(Finder);
WindowList_BroadcastAsync(YAMNVar.MessageWnds,WM_YAMN_STOPACCOUNT,(WPARAM)Finder,0);
- if (Plugin->Fcn->StopAccountFcnPtr!=NULL)
+ if (Plugin->Fcn->StopAccountFcnPtr != NULL)
Plugin->Fcn->StopAccountFcnPtr(Finder);
}
@@ -1191,7 +1191,7 @@ int WaitForAllAccounts(HYAMNPROTOPLUGIN Plugin,BOOL GetAccountBrowserAccess)
DebugLog(SynchroFile,"WaitForAllAccounts:AccountBrowserSO-write enter\n");
#endif
}
- for (Finder=Plugin->FirstAccount;Finder!=NULL;Finder=Finder->Next)
+ for (Finder=Plugin->FirstAccount;Finder != NULL;Finder=Finder->Next)
{
//2. wait for signal that account is not in use
#ifdef DEBUG_SYNCHRO
@@ -1230,7 +1230,7 @@ int DeleteAccounts(HYAMNPROTOPLUGIN Plugin)
WaitForAllAccounts(Plugin,FALSE);
- for (Finder=Plugin->FirstAccount;Finder!=NULL;)
+ for (Finder=Plugin->FirstAccount;Finder != NULL;)
{
HACCOUNT Next = Finder->Next;
DeletePluginAccountSvc((WPARAM)Finder,0);
@@ -1293,7 +1293,7 @@ int GetAccounts()
HACCOUNT Finder;
int cnt=0;
- for (Finder=Account;Finder!=NULL;Finder=Finder->Next)
+ for (Finder=Account;Finder != NULL;Finder=Finder->Next)
cnt++;
return cnt;
}
@@ -1302,7 +1302,7 @@ void WriteAccounts()
{
HACCOUNT Finder;
- for (Finder=Account;Finder!=NULL;Finder=Finder->Next)
+ for (Finder=Account;Finder != NULL;Finder=Finder->Next)
MessageBoxA(NULL,Finder->Name,"Browsing account",MB_OK);
}
#endif
diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp
index 6f11151ee3..791befd9fd 100644
--- a/plugins/YAMN/src/browser/badconnect.cpp
+++ b/plugins/YAMN/src/browser/badconnect.cpp
@@ -35,20 +35,20 @@ LRESULT CALLBACK BadConnectPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lPa
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"PopUpProc:LEFTCLICK:ActualAccountSO-read enter\n");
#endif
- if (ActualAccount->BadConnectN.App!=NULL)
+ if (ActualAccount->BadConnectN.App != NULL)
{
WCHAR *Command;
- if (ActualAccount->BadConnectN.AppParam!=NULL)
+ if (ActualAccount->BadConnectN.AppParam != NULL)
Command=new WCHAR[wcslen(ActualAccount->BadConnectN.App)+wcslen(ActualAccount->BadConnectN.AppParam)+6];
else
Command=new WCHAR[wcslen(ActualAccount->BadConnectN.App)+6];
- if (Command!=NULL)
+ if (Command != NULL)
{
lstrcpyW(Command,L"\"");
lstrcatW(Command,ActualAccount->BadConnectN.App);
lstrcatW(Command,L"\" ");
- if (ActualAccount->BadConnectN.AppParam!=NULL)
+ if (ActualAccount->BadConnectN.AppParam != NULL)
lstrcatW(Command,ActualAccount->BadConnectN.AppParam);
CreateProcessW(NULL,Command,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);
delete[] Command;
@@ -108,7 +108,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToReadFcn(ActualAccount->AccountAccessSO))
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read wait failed\n");
@@ -138,7 +138,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA
lstrcpyn(BadConnectPopUp.lptzContactName,_A2T(ActualAccount->Name),SIZEOF(BadConnectPopUp.lptzContactName));
}
- if (ActualAccount->Plugin->Fcn!=NULL && ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr!=NULL)
+ if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr != NULL)
{
Message1W=ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr(ErrorCode);
SetDlgItemText(hDlg,IDC_STATICMSG,Message1W);
@@ -146,7 +146,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA
if (ShowPopUp)
PUAddPopUpT(&BadConnectPopUp);
}
- else if (ActualAccount->Plugin->Fcn!=NULL && ActualAccount->Plugin->Fcn->GetErrorStringAFcnPtr!=NULL)
+ else if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->GetErrorStringAFcnPtr != NULL)
{
Message1W=ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr(ErrorCode);
SetDlgItemText(hDlg,IDC_STATICMSG,Message1W);
@@ -172,11 +172,11 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA
SetWindowTextA(hDlg, TitleStrA);
delete[] TitleStrA;
- if (Message1A!=NULL)
+ if (Message1A != NULL)
delete[] Message1A;
- if (ActualAccount->Plugin->Fcn!=NULL && ActualAccount->Plugin->Fcn->DeleteErrorStringFcnPtr!=NULL && Message1A!=NULL)
+ if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->DeleteErrorStringFcnPtr != NULL && Message1A != NULL)
ActualAccount->Plugin->Fcn->DeleteErrorStringFcnPtr(Message1A);
- if (ActualAccount->Plugin->Fcn!=NULL && ActualAccount->Plugin->Fcn->DeleteErrorStringFcnPtr!=NULL && Message1W!=NULL)
+ if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->DeleteErrorStringFcnPtr != NULL && Message1W != NULL)
ActualAccount->Plugin->Fcn->DeleteErrorStringFcnPtr(Message1W);
return 0;
}
@@ -270,7 +270,7 @@ DWORD WINAPI BadConnection(LPVOID Param)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToReadFcn(ActualAccount->AccountAccessSO))
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read wait failed\n");
@@ -280,8 +280,8 @@ DWORD WINAPI BadConnection(LPVOID Param)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read enter\n");
#endif
- for (src=ActualAccount->Name,dest=nid.szTip,i=0;(*src!=(TCHAR)0) && (i+1<sizeof(nid.szTip));*dest++=*src++);
- for (src=NotIconText;(*src!=(TCHAR)0) && (i+1<sizeof(nid.szTip));*dest++=*src++);
+ for (src=ActualAccount->Name,dest=nid.szTip,i=0;(*src != (TCHAR)0) && (i+1<sizeof(nid.szTip));*dest++=*src++);
+ for (src=NotIconText;(*src != (TCHAR)0) && (i+1<sizeof(nid.szTip));*dest++=*src++);
*dest=(TCHAR)0;
if (ActualAccount->BadConnectN.Flags & YAMN_ACC_SND)
@@ -303,7 +303,7 @@ DWORD WINAPI BadConnection(LPVOID Param)
}
// now, write to file. Why? Because we want to write when was new mail last checked
- if ((ActualAccount->Plugin->Fcn!=NULL) && (ActualAccount->Plugin->Fcn->WriteAccountsFcnPtr!=NULL) && ActualAccount->AbleToWork)
+ if ((ActualAccount->Plugin->Fcn != NULL) && (ActualAccount->Plugin->Fcn->WriteAccountsFcnPtr != NULL) && ActualAccount->AbleToWork)
ActualAccount->Plugin->Fcn->WriteAccountsFcnPtr();
}
__finally
@@ -324,15 +324,15 @@ INT_PTR RunBadConnectionSvc(WPARAM wParam,LPARAM lParam)
HANDLE ThreadRunningEV;
PYAMN_BADCONNECTIONPARAM Param=(PYAMN_BADCONNECTIONPARAM)wParam;
- if ((DWORD)lParam!=YAMN_BADCONNECTIONVERSION)
+ if ((DWORD)lParam != YAMN_BADCONNECTIONVERSION)
return 0;
- if (NULL!=(ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL)))
+ if (NULL != (ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL)))
{
HANDLE NewThread;
Param->ThreadRunningEV=ThreadRunningEV;
- if (NULL!=(NewThread=CreateThread(NULL,0,BadConnection,Param,0,&tid)))
+ if (NULL != (NewThread=CreateThread(NULL,0,BadConnection,Param,0,&tid)))
{
WaitForSingleObject(ThreadRunningEV,INFINITE);
CloseHandle(NewThread);
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp
index be88c467d3..370bf1f866 100644
--- a/plugins/YAMN/src/browser/mailbrowser.cpp
+++ b/plugins/YAMN/src/browser/mailbrowser.cpp
@@ -335,7 +335,7 @@ int UpdateMails(HWND hDlg,HACCOUNT ActualAccount,DWORD nflags,DWORD nnflags)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"UpdateMails:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToReadFcn(ActualAccount->AccountAccessSO))
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"UpdateMails:ActualAccountSO-read wait failed\n");
@@ -351,7 +351,7 @@ int UpdateMails(HWND hDlg,HACCOUNT ActualAccount,DWORD nflags,DWORD nnflags)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"UpdateMails:ActualAccountMsgsSO-write wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToWriteFcn(ActualAccount->MessagesAccessSO))
+ if (WAIT_OBJECT_0 != WaitToWriteFcn(ActualAccount->MessagesAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"UpdateMails:ActualAccountMsgsSO-write wait failed\n");
@@ -368,7 +368,7 @@ int UpdateMails(HWND hDlg,HACCOUNT ActualAccount,DWORD nflags,DWORD nnflags)
ZeroMemory(&MN,sizeof(MN));
- for (msgq=(HYAMNMAIL)ActualAccount->Mails;msgq!=NULL;msgq=msgq->Next)
+ for (msgq=(HYAMNMAIL)ActualAccount->Mails;msgq != NULL;msgq=msgq->Next)
{
if (!LoadedMailData(msgq)) //check if mail is already in memory
{
@@ -385,12 +385,12 @@ int UpdateMails(HWND hDlg,HACCOUNT ActualAccount,DWORD nflags,DWORD nnflags)
UnloadMailData(msgq); //do not keep data for mail in memory
}
- if (mwui!=NULL)
+ if (mwui != NULL)
mwui->UpdateMailsMessagesAccess=TRUE;
//Now we are going to check if extracting data from mail headers are needed.
//If popups will be displayed or mailbrowser window
- if ((((mwui!=NULL) && !(mwui->RunFirstTime)) &&
+ if ((((mwui != NULL) && !(mwui->RunFirstTime)) &&
(
((nnflags & YAMN_ACC_MSGP) && !(MN.Real.BrowserUC+MN.Virtual.BrowserUC)) ||
((nflags & YAMN_ACC_MSGP) && (MN.Real.BrowserUC+MN.Virtual.BrowserUC))
@@ -441,7 +441,7 @@ int UpdateMails(HWND hDlg,HACCOUNT ActualAccount,DWORD nflags,DWORD nnflags)
if (!RunMailBrowser)
SetRemoveFlagsInQueueFcn((HYAMNMAIL)ActualAccount->Mails,YAMN_MSG_UNSEEN,YAMN_MSG_STAYUNSEEN,YAMN_MSG_UNSEEN,YAMN_FLAG_REMOVE); //remove the unseen flag when it was not displayed and it has not "stay unseen" flag set
- if (mwui!=NULL)
+ if (mwui != NULL)
{
mwui->UpdateMailsMessagesAccess=FALSE;
mwui->RunFirstTime=FALSE;
@@ -455,7 +455,7 @@ int UpdateMails(HWND hDlg,HACCOUNT ActualAccount,DWORD nflags,DWORD nnflags)
if (RunMailBrowser)
UpdateWindow(GetDlgItem(hDlg,IDC_LISTMAILS));
- else if (hDlg!=NULL)
+ else if (hDlg != NULL)
DestroyWindow(hDlg);
return 1;
@@ -478,7 +478,7 @@ int ChangeExistingMailStatus(HWND hListView,HACCOUNT ActualAccount,struct CMailN
mail=(HYAMNMAIL)item.lParam;
else
continue;
- for (msgq=(HYAMNMAIL)ActualAccount->Mails;(msgq!=NULL)&&(msgq!=mail);msgq=msgq->Next); //found the same mail in account queue
+ for (msgq=(HYAMNMAIL)ActualAccount->Mails;(msgq != NULL)&&(msgq != mail);msgq=msgq->Next); //found the same mail in account queue
if (msgq==NULL) //if mail was not found
if (TRUE==ListView_DeleteItem(hListView,i))
{
@@ -510,7 +510,7 @@ int AddNewMailsToListView(HWND hListView,HACCOUNT ActualAccount,struct CMailNumb
ZeroMemory(&item,sizeof(item));
ZeroMemory(&UnicodeHeader,sizeof(UnicodeHeader));
- if (hListView!=NULL)
+ if (hListView != NULL)
{
item.mask=LVIF_TEXT | LVIF_PARAM;
item.iItem=0;
@@ -528,16 +528,16 @@ int AddNewMailsToListView(HWND hListView,HACCOUNT ActualAccount,struct CMailNumb
NewMailPopUp.PluginWindowProc=NewMailPopUpProc;
NewMailPopUp.PluginData=(void *)0; //it's new mail popup
- for (msgq=(HYAMNMAIL)ActualAccount->Mails;msgq!=NULL;msgq=msgq->Next,lfoundi++)
+ for (msgq=(HYAMNMAIL)ActualAccount->Mails;msgq != NULL;msgq=msgq->Next,lfoundi++)
{
// now we hide mail pointer to item's lParam member. We can later use it to retrieve mail datas
Extracted=FALSE;FromStr=NULL;FromStrNew=FALSE;
- if (hListView!=NULL)
+ if (hListView != NULL)
{
fi.lParam=(LPARAM)msgq;
- if (-1!=(foundi=ListView_FindItem(hListView,-1,&fi))) //if mail is already in window
+ if (-1 != (foundi=ListView_FindItem(hListView,-1,&fi))) //if mail is already in window
{
lfoundi=foundi;
continue; //do not insert any item
@@ -556,72 +556,68 @@ int AddNewMailsToListView(HWND hListView,HACCOUNT ActualAccount,struct CMailNumb
else
Loaded=true;
- if (((hListView!=NULL) && (msgq->Flags & YAMN_MSG_DISPLAY)) ||
+ if (((hListView != NULL) && (msgq->Flags & YAMN_MSG_DISPLAY)) ||
((nflags & YAMN_ACC_POP) && (ActualAccount->Flags & YAMN_ACC_POPN) && (msgq->Flags & YAMN_MSG_POPUP) && (msgq->Flags & YAMN_MSG_NEW)))
{
if (!Extracted) ExtractHeader(msgq->MailData->TranslatedHeader,msgq->MailData->CP,&UnicodeHeader);
Extracted=TRUE;
- if ((UnicodeHeader.From!=NULL) && (UnicodeHeader.FromNick!=NULL))
- {
+ if ((UnicodeHeader.From != NULL) && (UnicodeHeader.FromNick != NULL)) {
FromStr=new WCHAR[wcslen(UnicodeHeader.From)+wcslen(UnicodeHeader.FromNick)+4];
swprintf(FromStr,L"%s <%s>",UnicodeHeader.FromNick,UnicodeHeader.From);
FromStrNew=TRUE;
}
- else if (UnicodeHeader.From!=NULL)
+ else if (UnicodeHeader.From != NULL)
FromStr=UnicodeHeader.From;
- else if (UnicodeHeader.FromNick!=NULL)
+ else if (UnicodeHeader.FromNick != NULL)
FromStr=UnicodeHeader.FromNick;
- else if (UnicodeHeader.ReturnPath!=NULL)
+ else if (UnicodeHeader.ReturnPath != NULL)
FromStr=UnicodeHeader.ReturnPath;
- if (NULL==FromStr)
- {
- FromStr=L"";
- FromStrNew=FALSE;
+ if (NULL==FromStr) {
+ FromStr = L"";
+ FromStrNew = FALSE;
}
}
+ if ((hListView != NULL) && (msgq->Flags & YAMN_MSG_DISPLAY)) {
+ item.iSubItem = 0;
+ item.pszText = FromStr;
+ item.iItem = SendMessageW(hListView,LVM_INSERTITEMW,0,(LPARAM)&item);
- if ((hListView!=NULL) && (msgq->Flags & YAMN_MSG_DISPLAY))
- {
- item.iSubItem=0;
- item.pszText=FromStr;
- item.iItem=SendMessageW(hListView,LVM_INSERTITEMW,0,(LPARAM)&item);
-
- item.iSubItem=1;
- item.pszText=(NULL!=UnicodeHeader.Subject ? UnicodeHeader.Subject : (WCHAR*)L"");
+ item.iSubItem = 1;
+ item.pszText = (NULL != UnicodeHeader.Subject ? UnicodeHeader.Subject : (WCHAR*)L"");
SendMessageW(hListView,LVM_SETITEMTEXTW,(WPARAM)item.iItem,(LPARAM)&item);
- item.iSubItem=2;
+ item.iSubItem = 2;
swprintf(SizeStr,L"%d kB",msgq->MailData->Size/1024);
- item.pszText=SizeStr;
+ item.pszText = SizeStr;
SendMessageW(hListView,LVM_SETITEMTEXTW,(WPARAM)item.iItem,(LPARAM)&item);
- item.iSubItem=3;
- item.pszText=L"";
- { CMimeItem *heads;
- for (heads=msgq->MailData->TranslatedHeader;heads!=NULL;heads=heads->Next) {
- if (!_stricmp(heads->name,"Date")) {
- MimeDateToLocalizedDateTime(heads->value,LocalDateStr,128);
- item.pszText=LocalDateStr;
- break;
- } } }
+ item.iSubItem = 3;
+ item.pszText = L"";
+
+ for (CMimeItem *heads = msgq->MailData->TranslatedHeader; heads != NULL; heads = heads->Next) {
+ if ( !_stricmp(heads->name, "Date")) {
+ MimeDateToLocalizedDateTime(heads->value, LocalDateStr, 128);
+ item.pszText = LocalDateStr;
+ break;
+ }
+ }
SendMessageW(hListView,LVM_SETITEMTEXTW,(WPARAM)item.iItem,(LPARAM)&item);
}
- if ((nflags & YAMN_ACC_POP) && (ActualAccount->Flags & YAMN_ACC_POPN) && (msgq->Flags & YAMN_MSG_POPUP) && (msgq->Flags & YAMN_MSG_NEW))
- {
- WideCharToMultiByte(CP_ACP,0,FromStr,-1,(char *)NewMailPopUp.lptzContactName,sizeof(NewMailPopUp.lptzContactName),NULL,NULL);
- if (!WideCharToMultiByte(CP_ACP,0,UnicodeHeader.Subject,-1,(char *)NewMailPopUp.lptzText,sizeof(NewMailPopUp.lptzText),NULL,NULL))
- NewMailPopUp.lptzText[0]=0;
+ if ((nflags & YAMN_ACC_POP) && (ActualAccount->Flags & YAMN_ACC_POPN) && (msgq->Flags & YAMN_MSG_POPUP) && (msgq->Flags & YAMN_MSG_NEW)) {
+ lstrcpyn(NewMailPopUp.lptzContactName, FromStr, SIZEOF(NewMailPopUp.lptzContactName));
+ lstrcpyn(NewMailPopUp.lptzText, UnicodeHeader.Subject, SIZEOF(NewMailPopUp.lptzText));
+
PYAMN_MAILSHOWPARAM MailParam = (PYAMN_MAILSHOWPARAM)malloc(sizeof(YAMN_MAILSHOWPARAM));
if (MailParam) {
MailParam->account = ActualAccount;
MailParam->mail = msgq;
MailParam->ThreadRunningEV = 0;
- NewMailPopUp.PluginData=MailParam;
+ NewMailPopUp.PluginData = MailParam;
PUAddPopUpT(&NewMailPopUp);
}
}
@@ -699,8 +695,8 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
NewMailPopUp.colorText=nflags & YAMN_ACC_POPC ? ActualAccount->NewMailN.PopUpT : GetSysColor(COLOR_WINDOWTEXT);
NewMailPopUp.iSeconds=ActualAccount->NewMailN.PopUpTime;
- NewMailPopUp.PluginWindowProc=NewMailPopUpProc;
- NewMailPopUp.PluginData=(void *)0; //multiple popups
+ NewMailPopUp.PluginWindowProc = NewMailPopUpProc;
+ NewMailPopUp.PluginData = (void *)0; //multiple popups
lstrcpyn(NewMailPopUp.lptzContactName, _A2T(ActualAccount->Name),SIZEOF(NewMailPopUp.lptzContactName));
wsprintf(NewMailPopUp.lptzText,TranslateT("%d new mail message(s), %d total"),MN->Real.PopUpNC+MN->Virtual.PopUpNC,MN->Real.PopUpTC+MN->Virtual.PopUpTC);
@@ -708,7 +704,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
}
//destroy tray icon if no new mail
- if ((MN->Real.SysTrayUC+MN->Virtual.SysTrayUC==0) && (hDlg!=NULL))
+ if ((MN->Real.SysTrayUC+MN->Virtual.SysTrayUC==0) && (hDlg != NULL))
{
nid.hWnd=hDlg;
nid.uID=0;
@@ -720,7 +716,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
CallService(MS_CLIST_REMOVEEVENT,(WPARAM)ActualAccount->hContact,(LPARAM)ActualAccount->hContact);
}
- if ((MN->Real.BrowserUC+MN->Virtual.BrowserUC==0) && (hDlg!=NULL))
+ if ((MN->Real.BrowserUC+MN->Virtual.BrowserUC==0) && (hDlg != NULL))
{
if (!IsWindowVisible(hDlg) && !(nflags & YAMN_ACC_MSG))
PostMessage(hDlg,WM_DESTROY,0,0); //destroy window if no new mail and window is not visible
@@ -731,7 +727,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
}
}
else
- if (hDlg!=NULL) //else insert icon and set window if new mails
+ if (hDlg != NULL) //else insert icon and set window if new mails
{
SendMessageW(GetDlgItem(hDlg,IDC_LISTMAILS),LVM_SCROLL,0,(LPARAM)0x7ffffff);
@@ -741,8 +737,8 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
TCHAR *dest;
int i;
- for (src=ActualAccount->Name,dest=nid.szTip,i=0;(*src!=(TCHAR)0) && (i+1<sizeof(nid.szTip));*dest++=*src++);
- for (src=NotIconText;(*src!=(TCHAR)0) && (i+1<sizeof(nid.szTip));*dest++=*src++);
+ for (src=ActualAccount->Name,dest=nid.szTip,i=0;(*src != (TCHAR)0) && (i+1<sizeof(nid.szTip));*dest++=*src++);
+ for (src=NotIconText;(*src != (TCHAR)0) && (i+1<sizeof(nid.szTip));*dest++=*src++);
*dest=(TCHAR)0;
nid.cbSize=sizeof(NOTIFYICONDATA);
nid.hWnd=hDlg;
@@ -757,7 +753,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
ShowWindow(hDlg,SW_SHOWNORMAL);
}
- if (MN->Real.AppNC+MN->Virtual.AppNC!=0)
+ if (MN->Real.AppNC+MN->Virtual.AppNC != 0)
{
if (nflags & YAMN_ACC_APP)
{
@@ -766,20 +762,20 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
ZeroMemory(&si,sizeof(si));
si.cb=sizeof(si);
- if (ActualAccount->NewMailN.App!=NULL)
+ if (ActualAccount->NewMailN.App != NULL)
{
WCHAR *Command;
- if (ActualAccount->NewMailN.AppParam!=NULL)
+ if (ActualAccount->NewMailN.AppParam != NULL)
Command=new WCHAR[wcslen(ActualAccount->NewMailN.App)+wcslen(ActualAccount->NewMailN.AppParam)+6];
else
Command=new WCHAR[wcslen(ActualAccount->NewMailN.App)+6];
- if (Command!=NULL)
+ if (Command != NULL)
{
lstrcpyW(Command,L"\"");
lstrcatW(Command,ActualAccount->NewMailN.App);
lstrcatW(Command,L"\" ");
- if (ActualAccount->NewMailN.AppParam!=NULL)
+ if (ActualAccount->NewMailN.AppParam != NULL)
lstrcatW(Command,ActualAccount->NewMailN.AppParam);
CreateProcessW(NULL,Command,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);
delete[] Command;
@@ -788,7 +784,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR
}
}
- if (MN->Real.SoundNC+MN->Virtual.SoundNC!=0)
+ if (MN->Real.SoundNC+MN->Virtual.SoundNC != 0)
if (nflags & YAMN_ACC_SND)
CallService(MS_SKIN_PLAYSOUND,0,(LPARAM)YAMN_NEWMAILSOUND);
@@ -843,7 +839,7 @@ LRESULT CALLBACK NewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam
{
case WM_COMMAND:
//if clicked and it's new mail popup window
- if ((HIWORD(wParam)==STN_CLICKED) && (-1!=(PluginParam=CallService(MS_POPUP_GETPLUGINDATA,(WPARAM)hWnd,(LPARAM)&PluginParam))))
+ if ((HIWORD(wParam)==STN_CLICKED) && (-1 != (PluginParam=CallService(MS_POPUP_GETPLUGINDATA,(WPARAM)hWnd,(LPARAM)&PluginParam))))
{
HANDLE hContact = 0;
HACCOUNT Account;
@@ -852,9 +848,9 @@ LRESULT CALLBACK NewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam
memcpy(MailParam,(PINT_PTR)PluginParam,sizeof(YAMN_MAILSHOWPARAM));
hContact = MailParam->account->hContact;
Account = MailParam->account;
- if (NULL!=(MailParam->ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL))) {
+ if (NULL != (MailParam->ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL))) {
HANDLE NewThread;
- if (NULL!=(NewThread=CreateThread(NULL,0,ShowEmailThread,(LPVOID)MailParam,0,NULL)))
+ if (NULL != (NewThread=CreateThread(NULL,0,ShowEmailThread,(LPVOID)MailParam,0,NULL)))
{
CloseHandle(NewThread);
}
@@ -916,7 +912,7 @@ LRESULT CALLBACK NewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam
case UM_FREEPLUGINDATA:{
PYAMN_MAILSHOWPARAM mpd = (PYAMN_MAILSHOWPARAM)PUGetPluginData(hWnd);
HANDLE hContact = 0;
- if ((mpd) && (INT_PTR)mpd!=-1)free(mpd);
+ if ((mpd) && (INT_PTR)mpd != -1)free(mpd);
return FALSE;
}
case UM_INITPOPUP:
@@ -942,7 +938,7 @@ LRESULT CALLBACK NewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam
else
ActualAccount = (HACCOUNT) hContact;
- if ((HACCOUNT)wParam!=ActualAccount)
+ if ((HACCOUNT)wParam != ActualAccount)
break;
DestroyWindow(hWnd);
return 0;
@@ -1042,7 +1038,7 @@ LRESULT CALLBACK NoNewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lPar
else
ActualAccount = (HACCOUNT) hContact;
- if ((HACCOUNT)wParam!=ActualAccount)
+ if ((HACCOUNT)wParam != ActualAccount)
break;
DestroyWindow(hWnd);
@@ -1174,7 +1170,7 @@ void FileTimeToLocalizedDateTime(LONGLONG filetime, WCHAR *dateout, int lendateo
} else {
dateout[lendateout-1]=0;
int templen = 0;
- if (!willShowDate) willShowDate = (wTodayYear!=st.wYear)||(wTodayMonth!=st.wMonth)||(wTodayDay!=st.wDay);
+ if (!willShowDate) willShowDate = (wTodayYear != st.wYear)||(wTodayMonth != st.wMonth)||(wTodayDay != st.wDay);
if (willShowDate) {
templen = GetDateFormatW(localeID,(optDateTime&SHOWDATELONG)?DATE_LONGDATE:DATE_SHORTDATE,&st,NULL,dateout,lendateout-2);
dateout[templen-1] = ' ';
@@ -1346,9 +1342,9 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
LVCOLUMNW lvc1={LVCF_FMT | LVCF_TEXT | LVCF_WIDTH,LVCFMT_LEFT,400,iValueW,0,0};
SendMessageW(hListView,LVM_INSERTCOLUMNW,0,(LPARAM)&lvc0);
SendMessageW(hListView,LVM_INSERTCOLUMNW,(WPARAM)1,(LPARAM)&lvc1);
- if (NULL!=iHeaderW)
+ if (NULL != iHeaderW)
delete[] iHeaderW;
- if (NULL!=iValueW)
+ if (NULL != iValueW)
delete[] iValueW;
//WindowList_Add(YAMNVar.MessageWnds,hDlg,NULL);
@@ -1372,7 +1368,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
item.mask=LVIF_TEXT | LVIF_PARAM;
WCHAR *From=0,*Subj=0;
char *contentType=0, *transEncoding=0, *body=0; //should not be delete[]-ed
- for (Header=MailParam->mail->MailData->TranslatedHeader;Header!=NULL;Header=Header->Next)
+ for (Header=MailParam->mail->MailData->TranslatedHeader;Header != NULL;Header=Header->Next)
{
WCHAR *str1 = 0;
WCHAR *str2 = 0;
@@ -1459,7 +1455,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
}
} else if (!_strnicmp(contentType,"multipart/",10)) {
char *bondary=NULL;
- if (NULL!=(bondary=ExtractFromContentType(contentType,"boundary=")))
+ if (NULL != (bondary=ExtractFromContentType(contentType,"boundary=")))
{
bodyDecoded = ParseMultipartBody(body,bondary);
delete[] bondary;
@@ -1510,7 +1506,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
if (NULL==MailParam)
break;
- if ((HACCOUNT)wParam!=MailParam->account)
+ if ((HACCOUNT)wParam != MailParam->account)
break;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"ShowMessage:STOPACCOUNT:sending destroy msg\n");
@@ -1571,7 +1567,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
{
HWND hList = GetDlgItem(hDlg,IDC_LISTHEADERS);
HWND hEdit = GetDlgItem(hDlg,IDC_EDITBODY);
- BOOL changeX = LOWORD(lParam)!=HeadSizeX;
+ BOOL changeX = LOWORD(lParam) != HeadSizeX;
BOOL isBodyShown = ((PYAMN_MAILSHOWPARAM)(GetWindowLongPtr(hDlg,DWLP_USER)))->mail->Flags & YAMN_MSG_BODYRECEIVED;
HeadSizeX=LOWORD(lParam); //((LPRECT)lParam)->right-((LPRECT)lParam)->left;
HeadSizeY=HIWORD(lParam); //((LPRECT)lParam)->bottom-((LPRECT)lParam)->top;
@@ -1714,7 +1710,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:INIT:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToReadFcn(ActualAccount->AccountAccessSO))
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:INIT:ActualAccountSO-read enter failed\n");
@@ -1740,7 +1736,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
SendMessageW(GetDlgItem(hDlg,IDC_LISTMAILS),LVM_INSERTCOLUMNW,(WPARAM)2,(LPARAM)&lvc2);
SendMessageW(GetDlgItem(hDlg,IDC_LISTMAILS),LVM_INSERTCOLUMNW,(WPARAM)3,(LPARAM)&lvc3);
- if ((ActualAccount->NewMailN.App!=NULL) && (wcslen(ActualAccount->NewMailN.App)))
+ if ((ActualAccount->NewMailN.App != NULL) && (wcslen(ActualAccount->NewMailN.App)))
EnableWindow(GetDlgItem(hDlg,IDC_BTNAPP),(WPARAM)TRUE);
else
EnableWindow(GetDlgItem(hDlg,IDC_BTNAPP),(WPARAM)FALSE);
@@ -1815,7 +1811,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:DESTROY:ActualAccountMsgsSO-write wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToWriteFcn(ActualAccount->MessagesAccessSO))
+ if (WAIT_OBJECT_0 != WaitToWriteFcn(ActualAccount->MessagesAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:DESTROY:ActualAccountMsgsSO-write wait failed\n");
@@ -1826,7 +1822,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
DebugLog(SynchroFile,"MailBrowser:DESTROY:ActualAccountMsgsSO-write enter\n");
#endif
//delete mails from queue, which are deleted from server (spam level 3 mails e.g.)
- for (Parser=(HYAMNMAIL)ActualAccount->Mails;Parser!=NULL;Parser=Parser->Next)
+ for (Parser=(HYAMNMAIL)ActualAccount->Mails;Parser != NULL;Parser=Parser->Next)
{
if ((Parser->Flags & YAMN_MSG_DELETED) && YAMN_MSG_SPAML(Parser->Flags,YAMN_MSG_SPAML3) && mwui->Seen) //if spaml3 was already deleted and user knows about it
{
@@ -1869,7 +1865,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
if (NULL==(ActualAccount=GetWindowAccount(hDlg)))
break;
- if ((HACCOUNT)wParam!=ActualAccount)
+ if ((HACCOUNT)wParam != ActualAccount)
break;
TCHAR accstatus[512];
@@ -1928,7 +1924,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
if (NULL==(ActualAccount=GetWindowAccount(hDlg)))
return 0;
- if ((HACCOUNT)wParam!=ActualAccount)
+ if ((HACCOUNT)wParam != ActualAccount)
return 0;
nflags=um->Flags->nflags;
@@ -1947,7 +1943,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
if (NULL==(ActualAccount=GetWindowAccount(hDlg)))
break;
- if ((HACCOUNT)wParam!=ActualAccount)
+ if ((HACCOUNT)wParam != ActualAccount)
break;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:STOPACCOUNT:sending destroy msg\n");
@@ -1967,7 +1963,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:DBLCLICKICON:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToReadFcn(ActualAccount->AccountAccessSO))
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:DBLCLICKICON:ActualAccountSO-read wait failed\n");
@@ -1997,7 +1993,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
int iSelect;
iSelect=SendMessage(GetDlgItem(hDlg,IDC_LISTMAILS),LVM_GETNEXTITEM,-1,MAKELPARAM((UINT)LVNI_FOCUSED,0)); // return item selected
- if (iSelect!=-1)
+ if (iSelect != -1)
{
LV_ITEMW item;
HYAMNMAIL ActualMail;
@@ -2008,15 +2004,15 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
item.stateMask=0xFFFFFFFF;
ListView_GetItem(GetDlgItem(hDlg,IDC_LISTMAILS),&item);
ActualMail=(HYAMNMAIL)item.lParam;
- if (NULL!=ActualMail)
+ if (NULL != ActualMail)
{
//ShowEmailThread
PYAMN_MAILSHOWPARAM MailParam = new YAMN_MAILSHOWPARAM;
MailParam->account = GetWindowAccount(hDlg);
MailParam->mail = ActualMail;
- if (NULL!=(MailParam->ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL))) {
+ if (NULL != (MailParam->ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL))) {
HANDLE NewThread;
- if (NULL!=(NewThread=CreateThread(NULL,0,ShowEmailThread,MailParam,0,NULL)))
+ if (NULL != (NewThread=CreateThread(NULL,0,ShowEmailThread,MailParam,0,NULL)))
{
//WaitForSingleObject(MailParam->ThreadRunningEV,INFINITE);
CloseHandle(NewThread);
@@ -2081,20 +2077,20 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:BTNAPP:ActualAccountSO-read enter\n");
#endif
- if (ActualAccount->NewMailN.App!=NULL)
+ if (ActualAccount->NewMailN.App != NULL)
{
WCHAR *Command;
- if (ActualAccount->NewMailN.AppParam!=NULL)
+ if (ActualAccount->NewMailN.AppParam != NULL)
Command=new WCHAR[wcslen(ActualAccount->NewMailN.App)+wcslen(ActualAccount->NewMailN.AppParam)+6];
else
Command=new WCHAR[wcslen(ActualAccount->NewMailN.App)+6];
- if (Command!=NULL)
+ if (Command != NULL)
{
lstrcpyW(Command,L"\"");
lstrcatW(Command,ActualAccount->NewMailN.App);
lstrcatW(Command,L"\" ");
- if (ActualAccount->NewMailN.AppParam!=NULL)
+ if (ActualAccount->NewMailN.AppParam != NULL)
lstrcatW(Command,ActualAccount->NewMailN.AppParam);
CreateProcessW(NULL,Command,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);
delete[] Command;
@@ -2177,7 +2173,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:BTNDEL:ActualAccountMsgsSO-write enter\n");
#endif
- for (ActualMail=(HYAMNMAIL)ActualAccount->Mails;ActualMail!=NULL;ActualMail=ActualMail->Next)
+ for (ActualMail=(HYAMNMAIL)ActualAccount->Mails;ActualMail != NULL;ActualMail=ActualMail->Next)
{
if ((ActualMail->Flags & YAMN_MSG_DELETED) && ((ActualMail->Flags & YAMN_MSG_USERDELETE))) //if selected mail was already deleted
{
@@ -2191,7 +2187,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
// Create new thread which deletes marked mails.
HANDLE NewThread;
- if (NULL!=(NewThread=CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)ActualAccount->Plugin->Fcn->DeleteMailsFcnPtr,(LPVOID)&ParamToDeleteMails,0,&tid)))
+ if (NULL != (NewThread=CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)ActualAccount->Plugin->Fcn->DeleteMailsFcnPtr,(LPVOID)&ParamToDeleteMails,0,&tid)))
{
WaitForSingleObject(ThreadRunningEV,INFINITE);
CloseHandle(NewThread);
@@ -2268,7 +2264,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
break;
case LVN_COLUMNCLICK:
HACCOUNT ActualAccount;
- if (NULL!=(ActualAccount=GetWindowAccount(hDlg))) {
+ if (NULL != (ActualAccount=GetWindowAccount(hDlg))) {
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)lParam;
if (WAIT_OBJECT_0==WaitToReadFcn(ActualAccount->AccountAccessSO))
{
@@ -2336,7 +2332,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
DebugLog(SynchroFile,"MailBrowser:DRAWITEM:ActualAccountMsgsSO-read wait\n");
#endif
if (!umma)
- if (WAIT_OBJECT_0!=WaitToReadFcn(ActualAccount->MessagesAccessSO))
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->MessagesAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:DRAWITEM:ActualAccountMsgsSO-read wait failed\n");
@@ -2513,7 +2509,7 @@ DWORD WINAPI MailBrowser(LPVOID Param)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToReadFcn(ActualAccount->AccountAccessSO))
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"MailBrowser:ActualAccountSO-read wait failed\n");
@@ -2535,7 +2531,7 @@ DWORD WINAPI MailBrowser(LPVOID Param)
#endif
ReadDoneFcn(ActualAccount->AccountAccessSO);
- if (NULL!=(hMailBrowser=WindowList_Find(YAMNVar.NewMailAccountWnd,ActualAccount)))
+ if (NULL != (hMailBrowser=WindowList_Find(YAMNVar.NewMailAccountWnd,ActualAccount)))
WndFound=TRUE;
if ((hMailBrowser==NULL) && ((MyParam.nflags & YAMN_ACC_MSG) || (MyParam.nflags & YAMN_ACC_ICO) || (MyParam.nnflags & YAMN_ACC_MSG)))
{
@@ -2545,7 +2541,7 @@ DWORD WINAPI MailBrowser(LPVOID Param)
MoveWindow(hMailBrowser,PosX,PosY,SizeX,SizeY,TRUE);
}
- if (hMailBrowser!=NULL)
+ if (hMailBrowser != NULL)
{
struct CChangeContent Params={MyParam.nflags,MyParam.nnflags}; //if this thread created window, just post message to update mails
@@ -2554,7 +2550,7 @@ DWORD WINAPI MailBrowser(LPVOID Param)
else
UpdateMails(NULL,ActualAccount,MyParam.nflags,MyParam.nnflags); //update mails without displaying or refreshing any window
- if ((hMailBrowser!=NULL) && !WndFound) //we process message loop only for thread that created window
+ if ((hMailBrowser != NULL) && !WndFound) //we process message loop only for thread that created window
{
while(GetMessage(&msg,NULL,0,0))
{
@@ -2566,7 +2562,7 @@ DWORD WINAPI MailBrowser(LPVOID Param)
}
}
- if ((!WndFound) && (ActualAccount->Plugin->Fcn!=NULL) && (ActualAccount->Plugin->Fcn->WriteAccountsFcnPtr!=NULL) && ActualAccount->AbleToWork)
+ if ((!WndFound) && (ActualAccount->Plugin->Fcn != NULL) && (ActualAccount->Plugin->Fcn->WriteAccountsFcnPtr != NULL) && ActualAccount->AbleToWork)
ActualAccount->Plugin->Fcn->WriteAccountsFcnPtr();
}
__finally
@@ -2586,15 +2582,15 @@ INT_PTR RunMailBrowserSvc(WPARAM wParam,LPARAM lParam)
HANDLE ThreadRunningEV;
PYAMN_MAILBROWSERPARAM Param=(PYAMN_MAILBROWSERPARAM)wParam;
- if ((DWORD)lParam!=YAMN_MAILBROWSERVERSION)
+ if ((DWORD)lParam != YAMN_MAILBROWSERVERSION)
return 0;
- if (NULL!=(ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL)))
+ if (NULL != (ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL)))
{
HANDLE NewThread;
Param->ThreadRunningEV=ThreadRunningEV;
- if (NULL!=(NewThread=CreateThread(NULL,0,MailBrowser,Param,0,&tid)))
+ if (NULL != (NewThread=CreateThread(NULL,0,MailBrowser,Param,0,&tid)))
{
WaitForSingleObject(ThreadRunningEV,INFINITE);
CloseHandle(NewThread);
diff --git a/plugins/YAMN/src/filterplugin.cpp b/plugins/YAMN/src/filterplugin.cpp
index 8f61003293..b1ad1f0abf 100644
--- a/plugins/YAMN/src/filterplugin.cpp
+++ b/plugins/YAMN/src/filterplugin.cpp
@@ -50,7 +50,7 @@ INT_PTR RegisterFilterPluginSvc(WPARAM wParam,LPARAM lParam)
PYAMN_FILTERREGISTRATION Registration=(PYAMN_FILTERREGISTRATION)wParam;
HYAMNFILTERPLUGIN Plugin;
- if (lParam!=YAMN_FILTERREGISTRATIONVERSION)
+ if (lParam != YAMN_FILTERREGISTRATIONVERSION)
return 0;
if ((Registration->Name==NULL) || (Registration->Ver==NULL))
return NULL;
@@ -78,8 +78,8 @@ INT_PTR UnregisterFilterPlugin(HYAMNFILTERPLUGIN Plugin)
}
else
{
- for (Parser=FirstFilterPlugin;(Parser->Next!=NULL) && (Plugin!=Parser->Next->Plugin);Parser=Parser->Next);
- if (Parser->Next!=NULL)
+ for (Parser=FirstFilterPlugin;(Parser->Next != NULL) && (Plugin != Parser->Next->Plugin);Parser=Parser->Next);
+ if (Parser->Next != NULL)
{
Found=Parser->Next;
Parser->Next=Parser->Next->Next;
@@ -87,9 +87,9 @@ INT_PTR UnregisterFilterPlugin(HYAMNFILTERPLUGIN Plugin)
else
Found=NULL;
}
- if (Found!=NULL)
+ if (Found != NULL)
{
- if (Plugin->FilterFcn->UnLoadFcn!=NULL)
+ if (Plugin->FilterFcn->UnLoadFcn != NULL)
Plugin->FilterFcn->UnLoadFcn((void *)0);
delete Found->Plugin;
@@ -117,7 +117,7 @@ INT_PTR UnregisterFilterPlugins()
{
EnterCriticalSection(&PluginRegCS);
//We remove protocols from the protocol list
- while(FirstFilterPlugin!=NULL)
+ while(FirstFilterPlugin != NULL)
UnregisterFilterPlugin(FirstFilterPlugin->Plugin);
LeaveCriticalSection(&PluginRegCS);
return 1;
@@ -127,7 +127,7 @@ int WINAPI SetFilterPluginFcnImportFcn(HYAMNFILTERPLUGIN Plugin,DWORD Importance
{
PYAMN_FILTERPLUGINQUEUE Parser,Previous;
- if (YAMNFilterFcnVer!=YAMN_FILTERIMPORTFCNVERSION)
+ if (YAMNFilterFcnVer != YAMN_FILTERIMPORTFCNVERSION)
return 0;
if (YAMNFilterFcn==NULL)
return 0;
@@ -140,7 +140,7 @@ int WINAPI SetFilterPluginFcnImportFcn(HYAMNFILTERPLUGIN Plugin,DWORD Importance
EnterCriticalSection(&PluginRegCS);
//We add protocol to the protocol list
- for (Previous=NULL,Parser=FirstFilterPlugin;Parser!=NULL && Parser->Next!=NULL && Parser->Plugin->Importance<=Importance;Previous=Parser,Parser=Parser->Next);
+ for (Previous=NULL,Parser=FirstFilterPlugin;Parser != NULL && Parser->Next != NULL && Parser->Plugin->Importance<=Importance;Previous=Parser,Parser=Parser->Next);
if (Previous==NULL) //insert to the beginnig of queue
{
FirstFilterPlugin=new YAMN_FILTERPLUGINQUEUE;
@@ -173,9 +173,9 @@ INT_PTR FilterMailSvc(WPARAM wParam,LPARAM lParam)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"FilterMail:ActualAccountMsgsSO-write enter\n");
#endif
- for (ActualPlugin=FirstFilterPlugin;ActualPlugin!=NULL;ActualPlugin=ActualPlugin->Next)
+ for (ActualPlugin=FirstFilterPlugin;ActualPlugin != NULL;ActualPlugin=ActualPlugin->Next)
{
- if (ActualPlugin->Plugin->FilterFcn->FilterMailFcnPtr!=NULL)
+ if (ActualPlugin->Plugin->FilterFcn->FilterMailFcnPtr != NULL)
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tFiltering Mail, running plugin %0x to filter mail\n",ActualPlugin->Plugin);
diff --git a/plugins/YAMN/src/mails/decode.cpp b/plugins/YAMN/src/mails/decode.cpp
index 3af1edc056..a0d96dbfb0 100644
--- a/plugins/YAMN/src/mails/decode.cpp
+++ b/plugins/YAMN/src/mails/decode.cpp
@@ -211,7 +211,7 @@ int GetCharsetFromString(char *input,size_t size)
if ((size<1) || (parser=pout=new char[size+1])==NULL)
return -1;
- while((*pin!=0) && (pin-input< (INT_PTR)size))
+ while((*pin != 0) && (pin-input< (INT_PTR)size))
{
if ((*pin>='a') && (*pin<='z'))
*parser++=*(pin++)-('a'-'A'); // make it capital
@@ -300,7 +300,7 @@ int DecodeQuotedPrintable(char *Src,char *Dst,int DstLen, BOOL isQ)
char *DstTemp=Dst;
DebugLog(DecodeFile,"<Decode Quoted><Input>%s</Input>",Src);
#endif
- for (int Counter=0;((char)*Src!=0) && DstLen && (Counter++<DstLen);Src++,Dst++)
+ for (int Counter=0;((char)*Src != 0) && DstLen && (Counter++<DstLen);Src++,Dst++)
if (*Src=='=')
{
if (!isQ) {
@@ -352,7 +352,7 @@ int DecodeBase64(char *Src,char *Dst,int DstLen)
char *DstTemp=Dst;
DebugLog(DecodeFile,"<Decode Base64><Input>\n%s\n</Input>\n",Src);
#endif
- while(*Src!=0 && DstLen && Dst!=End)
+ while(*Src != 0 && DstLen && Dst != End)
{
if ((*Src==0x0D)||(*Src==0x0A)) {
Src++;
@@ -392,7 +392,7 @@ int ConvertStringToUnicode(char *stream,unsigned int cp,WCHAR **out)
//codepages, which require to have set 0 in dwFlags parameter when calling MultiByteToWideChar
DWORD CodePagesZeroFlags[]={50220,50221,50222,50225,50227,50229,52936,54936,57002,57003,57004,57005,57006,57007,57008,57009,57010,57011,65000,65001};
- if ((cp!=CP_ACP) && (cp!=CP_OEMCP) && (cp!=CP_MACCP) && (cp!=CP_THREAD_ACP) && (cp!=CP_SYMBOL) && (cp!=CP_UTF7) && (cp!=CP_UTF8) && !GetCPInfo(cp,&CPInfo))
+ if ((cp != CP_ACP) && (cp != CP_OEMCP) && (cp != CP_MACCP) && (cp != CP_THREAD_ACP) && (cp != CP_SYMBOL) && (cp != CP_UTF7) && (cp != CP_UTF8) && !GetCPInfo(cp,&CPInfo))
cp=CP_ACP;
#ifdef DEBUG_DECODECODEPAGE
DebugLog(DecodeFile,"<CodePage #>%d</CodePage #>",cp);
@@ -409,15 +409,15 @@ int ConvertStringToUnicode(char *stream,unsigned int cp,WCHAR **out)
else
streamlen=MultiByteToWideChar(cp,MB_USEGLYPHCHARS,stream,-1,NULL,0);
- if (*out!=NULL)
+ if (*out != NULL)
outlen=wcslen(*out);
else
outlen=0;
temp=new WCHAR[streamlen+outlen+1];
- if (*out!=NULL)
+ if (*out != NULL)
{
- for (dest=temp;*src!=(WCHAR)0;src++,dest++) //copy old string from *out to temp
+ for (dest=temp;*src != (WCHAR)0;src++,dest++) //copy old string from *out to temp
*dest=*src;
// *dest++=L' '; //add space?
delete[] *out;
@@ -455,7 +455,7 @@ void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode)
size_t tempstoreLength = wcslen(tempstore);
size_t outind = 0;
- while(*start!=0) {
+ while(*start != 0) {
if (CODES(start)) {
finder=start+2;finderend=finder;
while(!CODED(finderend) && !EOS(finderend)) finderend++;
@@ -475,7 +475,7 @@ void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode)
}
if (-1==(cp=(DWORD)GetCharsetFromString(finder,finderend-finder)))
cp=CP_ACP;
- if (Encoding!=0)
+ if (Encoding != 0)
{
int size,codeend;
char *pcodeend;
@@ -509,7 +509,7 @@ void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode)
size=finderend-finder+1+1;
break;
}
- if (DecodedResult!=NULL)
+ if (DecodedResult != NULL)
delete[] DecodedResult;
DecodedResult=new char[size+1];
switch(Encoding)
diff --git a/plugins/YAMN/src/mails/mails.cpp b/plugins/YAMN/src/mails/mails.cpp
index 785fc5d8d9..758a00dbd5 100644
--- a/plugins/YAMN/src/mails/mails.cpp
+++ b/plugins/YAMN/src/mails/mails.cpp
@@ -124,12 +124,12 @@ INT_PTR CreateAccountMailSvc(WPARAM wParam,LPARAM lParam)
HYAMNMAIL NewMail;
//test if we are going to initialize members of suitable structure (structures of plugin and YAMN must match)
- if (MailVersion!=YAMN_MAILVERSION)
+ if (MailVersion != YAMN_MAILVERSION)
return NULL;
- if (Account->Plugin!=NULL)
+ if (Account->Plugin != NULL)
{
- if (Account->Plugin->MailFcn->NewMailFcnPtr!=NULL)
+ if (Account->Plugin->MailFcn->NewMailFcnPtr != NULL)
{
//Let plugin create its own structure, which can be derived from CAccount structure
if (NULL==(NewMail=Account->Plugin->MailFcn->NewMailFcnPtr(Account,YAMN_MAILVERSION)))
@@ -155,29 +155,29 @@ INT_PTR DeleteAccountMailSvc(WPARAM wParam,LPARAM lParam)
HYAMNMAIL OldMail=(HYAMNMAIL)lParam;
struct CMimeItem *TH;
- if (Plugin->MailFcn!=NULL) {
- if (Plugin->MailFcn->DeleteMailFcnPtr!=NULL) {
+ if (Plugin->MailFcn != NULL) {
+ if (Plugin->MailFcn->DeleteMailFcnPtr != NULL) {
//Let plugin delete its own CMimeMsgQueue derived structure
Plugin->MailFcn->DeleteMailFcnPtr(OldMail);
return 1;
}
}
- if (OldMail->MailData!=NULL) {
- if (OldMail->MailData->Body!=NULL)
+ if (OldMail->MailData != NULL) {
+ if (OldMail->MailData->Body != NULL)
delete[] OldMail->MailData->Body;
- if ((TH=OldMail->MailData->TranslatedHeader)!=NULL)
- for (;OldMail->MailData->TranslatedHeader!=NULL;) {
+ if ((TH=OldMail->MailData->TranslatedHeader) != NULL)
+ for (;OldMail->MailData->TranslatedHeader != NULL;) {
TH=TH->Next;
- if (OldMail->MailData->TranslatedHeader->name!=NULL)
+ if (OldMail->MailData->TranslatedHeader->name != NULL)
delete[] OldMail->MailData->TranslatedHeader->name;
- if (OldMail->MailData->TranslatedHeader->value!=NULL)
+ if (OldMail->MailData->TranslatedHeader->value != NULL)
delete[] OldMail->MailData->TranslatedHeader->value;
delete OldMail->MailData->TranslatedHeader;
OldMail->MailData->TranslatedHeader=TH;
}
delete OldMail->MailData;
}
- if (OldMail->ID!=NULL)
+ if (OldMail->ID != NULL)
delete[] OldMail->ID;
delete OldMail; //consider mail as standard HYAMNMAIL, not initialized before and use its own destructor
@@ -188,7 +188,7 @@ INT_PTR DeleteAccountMailSvc(WPARAM wParam,LPARAM lParam)
void WINAPI AppendQueueFcn(HYAMNMAIL first,HYAMNMAIL second)
{
HYAMNMAIL Finder=first;
- while(Finder->Next!=NULL) Finder=Finder->Next;
+ while(Finder->Next != NULL) Finder=Finder->Next;
Finder->Next=second;
}
@@ -197,7 +197,7 @@ INT_PTR LoadMailDataSvc(WPARAM wParam,LPARAM lParam)
HYAMNMAIL Mail=(HYAMNMAIL)wParam;
DWORD MailVersion=(DWORD)lParam;
- if (MailVersion!=YAMN_MAILDATAVERSION)
+ if (MailVersion != YAMN_MAILDATAVERSION)
return NULL;
//now we have all data to memory persisting, so no loading is needed
@@ -217,7 +217,7 @@ INT_PTR SaveMailDataSvc(WPARAM wParam,LPARAM lParam)
HYAMNMAIL Mail=(HYAMNMAIL)wParam;
DWORD MailVersion=(DWORD)lParam;
- if (MailVersion!=YAMN_MAILDATAVERSION)
+ if (MailVersion != YAMN_MAILDATAVERSION)
return (INT_PTR)-1;
//now we have all data to memory persisting, so no saving is needed
@@ -234,10 +234,10 @@ void WINAPI SynchroMessagesFcn(HACCOUNT Account,HYAMNMAIL *OldQueue,HYAMNMAIL *R
HYAMNMAIL Parser,ParserPrev;
HYAMNMAIL RemovedOldParser =NULL;
HYAMNMAIL RemovedNewParser =NULL;
- if (RemovedOld!=NULL) *RemovedOld=NULL;
- if (RemovedNew!=NULL) *RemovedNew=NULL;
+ if (RemovedOld != NULL) *RemovedOld=NULL;
+ if (RemovedNew != NULL) *RemovedNew=NULL;
- for (FinderPrev=NULL,Finder=*OldQueue;Finder!=NULL;)
+ for (FinderPrev=NULL,Finder=*OldQueue;Finder != NULL;)
{
if (Finder->Flags & YAMN_MSG_DELETED) //if old queue contains deleted mail
{
@@ -245,7 +245,7 @@ void WINAPI SynchroMessagesFcn(HACCOUNT Account,HYAMNMAIL *OldQueue,HYAMNMAIL *R
Finder=Finder->Next; //get next message in old queue for testing
continue;
}
- for (ParserPrev=NULL,Parser=*NewQueue;Parser!=NULL;ParserPrev=Parser,Parser=Parser->Next)
+ for (ParserPrev=NULL,Parser=*NewQueue;Parser != NULL;ParserPrev=Parser,Parser=Parser->Next)
{
if (Parser->Flags & YAMN_MSG_DELETED)
continue;
@@ -256,7 +256,7 @@ void WINAPI SynchroMessagesFcn(HACCOUNT Account,HYAMNMAIL *OldQueue,HYAMNMAIL *R
if (0==strcmp(Parser->ID,Finder->ID)) //search for equal message in new queue
break;
}
- if (Parser!=NULL) //found equal message in new queue
+ if (Parser != NULL) //found equal message in new queue
{
if (Parser==*NewQueue)
*NewQueue=(*NewQueue)->Next;
@@ -319,7 +319,7 @@ void WINAPI SynchroMessagesFcn(HACCOUNT Account,HYAMNMAIL *OldQueue,HYAMNMAIL *R
void WINAPI DeleteMessagesToEndFcn(HACCOUNT Account,HYAMNMAIL From)
{
HYAMNMAIL Temp;
- while(From!=NULL)
+ while(From != NULL)
{
Temp=From;
From=From->Next;
@@ -339,14 +339,14 @@ void WINAPI DeleteMessageFromQueueFcn(HYAMNMAIL *From,HYAMNMAIL Which,int mode=0
}
else
{
- for (Parser=*From;Which!=Parser->Next;Parser=Parser->Next)
+ for (Parser=*From;Which != Parser->Next;Parser=Parser->Next)
if (mode && (Parser->Number>Number)) Parser->Number--;
if (mode && (Parser->Number>Number)) Parser->Number--;
Parser->Next=Parser->Next->Next;
Parser=Which->Next;
}
if (mode)
- for (;Parser!=NULL;Parser=Parser->Next)
+ for (;Parser != NULL;Parser=Parser->Next)
if (Parser->Number>Number) Parser->Number--;
}
@@ -354,7 +354,7 @@ void DeleteMessagesFromQueue(HYAMNMAIL *From,HYAMNMAIL Which,int mode=0)
{
HYAMNMAIL Parser;
- for (Parser=Which;Parser!=NULL;Parser=Parser->Next)
+ for (Parser=Which;Parser != NULL;Parser=Parser->Next)
DeleteMessageFromQueueFcn(From,Parser,mode);
}
@@ -362,7 +362,7 @@ HYAMNMAIL WINAPI FindMessageByIDFcn(HYAMNMAIL From,char *ID)
{
HYAMNMAIL Browser;
- for (Browser=From;Browser!=NULL;Browser=Browser->Next)
+ for (Browser=From;Browser != NULL;Browser=Browser->Next)
if (0==lstrcmpA(Browser->ID,ID))
break;
return Browser;
@@ -386,7 +386,7 @@ void WINAPI TranslateHeaderFcn(char *stream,int len,struct CMimeItem **head)
prev1=finder;
- while(*finder!=':' && !EOS(finder)) finder++;
+ while(*finder != ':' && !EOS(finder)) finder++;
if (!EOS(finder))
prev2=finder++;
else
@@ -404,7 +404,7 @@ void WINAPI TranslateHeaderFcn(char *stream,int len,struct CMimeItem **head)
while(!ENDLINE(finder) && !EOS(finder)) finder++;
}while(ENDLINEWS(finder));
- if (Item!=NULL)
+ if (Item != NULL)
{
if (NULL==(Item->Next=new struct CMimeItem))
break;
@@ -458,7 +458,7 @@ HYAMNMAIL WINAPI CreateNewDeleteQueueFcn(HYAMNMAIL From)
{
HYAMNMAIL FirstMail,Browser;
- for (FirstMail=NULL;From!=NULL;From=From->Next)
+ for (FirstMail=NULL;From != NULL;From=From->Next)
{
if ((From->Flags & (YAMN_MSG_USERDELETE | YAMN_MSG_AUTODELETE)) && !(From->Flags & YAMN_MSG_DELETED))
{
@@ -486,7 +486,7 @@ void WINAPI SetRemoveFlagsInQueueFcn(HYAMNMAIL From,DWORD FlagsSet,DWORD FlagsNo
{
HYAMNMAIL msgq;
- for (msgq=(HYAMNMAIL)From;msgq!=NULL;msgq=msgq->Next)
+ for (msgq=(HYAMNMAIL)From;msgq != NULL;msgq=msgq->Next)
{
if ((FlagsSet==(msgq->Flags & FlagsSet)) && (0==(msgq->Flags & FlagsNotSet)))
{
diff --git a/plugins/YAMN/src/mails/mime.cpp b/plugins/YAMN/src/mails/mime.cpp
index 13710a2557..33b7735b82 100644
--- a/plugins/YAMN/src/mails/mime.cpp
+++ b/plugins/YAMN/src/mails/mime.cpp
@@ -98,7 +98,7 @@ void CopyToHeader(char *srcstart,char *srcend,char **dest,int mode)
if (srcstart>=srcend)
return;
- if (NULL!=*dest)
+ if (NULL != *dest)
delete[] *dest;
if (NULL==(*dest=new char[srcend-srcstart+1]))
return;
@@ -127,7 +127,7 @@ void ExtractAddressFromLine(char *finder,char **storeto,char **storetonick)
return;
}
while(WS(finder)) finder++;
- if ((*finder)!='<')
+ if ((*finder) != '<')
{
char *finderend=finder+1;
do
@@ -138,12 +138,12 @@ void ExtractAddressFromLine(char *finder,char **storeto,char **storetonick)
}while(ENDLINEWS(finderend));
finderend--;
while(WS(finderend) || ENDLINE(finderend)) finderend--; //find the end of text, no whitespace
- if (*finderend!='>') //not '>' at the end of line
+ if (*finderend != '>') //not '>' at the end of line
CopyToHeader(finder,finderend+1,storeto,MIME_MAIL);
else //at the end of line, there's '>'
{
char *finder2=finderend;
- while((*finder2!='<') && (finder2>finder)) finder2--; //go to matching '<' or to the start
+ while((*finder2 != '<') && (finder2>finder)) finder2--; //go to matching '<' or to the start
CopyToHeader(finder2,finderend+1,storeto,MIME_MAIL);
if (*finder2=='<') //if we found '<', the rest copy as from nick
{
@@ -160,7 +160,7 @@ void ExtractAddressFromLine(char *finder,char **storeto,char **storetonick)
{
if (ENDLINEWS(finderend)) //after endline information continues
finderend+=2;
- while(!ENDLINE(finderend) && (*finderend!='>') && !EOS(finderend)) finderend++; //seek to the matching < or to the end of line or to the end of string
+ while(!ENDLINE(finderend) && (*finderend != '>') && !EOS(finderend)) finderend++; //seek to the matching < or to the end of line or to the end of string
}while(ENDLINEWS(finderend));
CopyToHeader(finder,finderend+1,storeto,MIME_MAIL); //go to first '>' or to the end and copy
finder=finderend+1;
@@ -213,13 +213,13 @@ char *ExtractFromContentType(char *ContentType,char *value)
temp=finder-1;
while((temp>ContentType) && WS(temp)) temp--; //now we have to find, if the word "Charset=" is located after ';' like "; Charset="
- if (*temp!=';' && !ENDLINE(temp) && temp!=ContentType)
+ if (*temp != ';' && !ENDLINE(temp) && temp != ContentType)
return NULL;
finder=finder+strlen(value); //jump over value string
while(WS(finder)) finder++; //jump over whitespaces
temp=finder;
- while(*temp!=0 && *temp!=';') temp++; //jump to the end of setting (to the next ;)
+ while(*temp != 0 && *temp != ';') temp++; //jump to the end of setting (to the next ;)
temp--;
while(WS(temp)) temp--; //remove whitespaces from the end
if (*finder=='\"') { //remove heading and tailing quotes
@@ -228,7 +228,7 @@ char *ExtractFromContentType(char *ContentType,char *value)
}
if (NULL==(CopiedString=new char[++temp-finder+1]))
return NULL;
- for (copier=CopiedString;finder!=temp;*copier++=*finder++); //copy string
+ for (copier=CopiedString;finder != temp;*copier++=*finder++); //copy string
*copier=0; //and end it with zero character
return CopiedString;
@@ -236,7 +236,7 @@ char *ExtractFromContentType(char *ContentType,char *value)
void ExtractShortHeader(struct CMimeItem *items,struct CShortHeader *head)
{
- for (;items!=NULL;items=items->Next)
+ for (;items != NULL;items=items->Next)
{
//at the start of line
//MessageBox(NULL,items->value,items->name,0);
@@ -314,7 +314,7 @@ void ExtractShortHeader(struct CMimeItem *items,struct CShortHeader *head)
DebugLog(DecodeFile,"</Extracting>\n");
#endif
ToLower(ContentType);
- if (NULL!=(CharSetStr=ExtractFromContentType(ContentType,"charset=")))
+ if (NULL != (CharSetStr=ExtractFromContentType(ContentType,"charset=")))
{
head->CP=GetCharsetFromString(CharSetStr,strlen(CharSetStr));
delete[] CharSetStr;
@@ -328,7 +328,7 @@ void ExtractShortHeader(struct CMimeItem *items,struct CShortHeader *head)
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Extracting importance>");
#endif
- if (head->Priority!=-1)
+ if (head->Priority != -1)
{
if (0==strncmp(items->value,"low",3))
head->Priority=5;
@@ -372,17 +372,17 @@ void ExtractHeader(struct CMimeItem *items,int &CP,struct CHeader *head)
head->Priority=ShortHeader.Priority==-1 ? 3 : ShortHeader.Priority;
CP=ShortHeader.CP==-1 ? CP : ShortHeader.CP;
#ifdef DEBUG_DECODE
- if (NULL!=ShortHeader.From)
+ if (NULL != ShortHeader.From)
DebugLog(DecodeFile,"<Decoded from>%s</Decoded)\n",ShortHeader.From);
- if (NULL!=ShortHeader.FromNick)
+ if (NULL != ShortHeader.FromNick)
DebugLog(DecodeFile,"<Decoded from-nick>%s</Decoded)\n",ShortHeader.FromNick);
- if (NULL!=ShortHeader.ReturnPath)
+ if (NULL != ShortHeader.ReturnPath)
DebugLog(DecodeFile,"<Decoded return-path>%s</Decoded)\n",ShortHeader.ReturnPath);
- if (NULL!=ShortHeader.ReturnPathNick)
+ if (NULL != ShortHeader.ReturnPathNick)
DebugLog(DecodeFile,"<Decoded return-path nick>%s</Decoded)\n",ShortHeader.ReturnPathNick);
- if (NULL!=ShortHeader.Subject)
+ if (NULL != ShortHeader.Subject)
DebugLog(DecodeFile,"<Decoded subject>%s</Decoded)\n",ShortHeader.Subject);
- if (NULL!=ShortHeader.Date)
+ if (NULL != ShortHeader.Date)
DebugLog(DecodeFile,"<Decoded date>%s</Decoded)\n",ShortHeader.Date);
DebugLog(DecodeFile,"</Extracting header>\n");
DebugLog(DecodeFile,"<Convert>\n");
@@ -391,38 +391,38 @@ void ExtractHeader(struct CMimeItem *items,int &CP,struct CHeader *head)
ConvertCodedStringToUnicode(ShortHeader.From,&head->From,CP,MIME_PLAIN);
#ifdef DEBUG_DECODE
- if (NULL!=head->From)
+ if (NULL != head->From)
DebugLogW(DecodeFile,L"<Converted from>%s</Converted>\n",head->From);
#endif
ConvertCodedStringToUnicode(ShortHeader.FromNick,&head->FromNick,CP,MIME_MAIL);
#ifdef DEBUG_DECODE
- if (NULL!=head->FromNick)
+ if (NULL != head->FromNick)
DebugLogW(DecodeFile,L"<Converted from-nick>%s</Converted>\n",head->FromNick);
#endif
ConvertCodedStringToUnicode(ShortHeader.ReturnPath,&head->ReturnPath,CP,MIME_PLAIN);
#ifdef DEBUG_DECODE
- if (NULL!=head->ReturnPath)
+ if (NULL != head->ReturnPath)
DebugLogW(DecodeFile,L"<Converted return-path>%s</Converted>\n",head->ReturnPath);
#endif
ConvertCodedStringToUnicode(ShortHeader.ReturnPathNick,&head->ReturnPathNick,CP,MIME_MAIL);
#ifdef DEBUG_DECODE
- if (NULL!=head->ReturnPathNick)
+ if (NULL != head->ReturnPathNick)
DebugLogW(DecodeFile,L"<Converted return-path nick>%s</Converted>\n",head->ReturnPathNick);
#endif
ConvertCodedStringToUnicode(ShortHeader.Subject,&head->Subject,CP,MIME_PLAIN);
#ifdef DEBUG_DECODE
- if (NULL!=head->Subject)
+ if (NULL != head->Subject)
DebugLogW(DecodeFile,L"<Converted subject>%s</Converted>\n",head->Subject);
#endif
ConvertCodedStringToUnicode(ShortHeader.Date,&head->Date,CP,MIME_PLAIN);
#ifdef DEBUG_DECODE
- if (NULL!=head->Date)
+ if (NULL != head->Date)
DebugLogW(DecodeFile,L"<Converted date>%s</Converted>\n",head->Date);
#endif
ConvertCodedStringToUnicode(ShortHeader.Body,&head->Body,CP,MIME_PLAIN);
#ifdef DEBUG_DECODE
- if (NULL!=head->Body)
+ if (NULL != head->Body)
DebugLogW(DecodeFile,L"<Converted Body>%s</Converted>\n",head->Body);
#endif
@@ -439,40 +439,40 @@ void ExtractHeader(struct CMimeItem *items,int &CP,struct CHeader *head)
void DeleteShortHeaderContent(struct CShortHeader *head)
{
- if (head->From!=NULL) delete[] head->From;
- if (head->FromNick!=NULL) delete[] head->FromNick;
- if (head->ReturnPath!=NULL) delete[] head->ReturnPath;
- if (head->ReturnPathNick!=NULL) delete[] head->ReturnPathNick;
- if (head->Subject!=NULL) delete[] head->Subject;
- if (head->Date!=NULL) delete[] head->Date;
- if (head->To!=NULL) DeleteShortNames(head->To);
- if (head->Cc!=NULL) DeleteShortNames(head->Cc);
- if (head->Bcc!=NULL) DeleteShortNames(head->Bcc);
- if (head->Body!=NULL) delete[] head->Body;
+ if (head->From != NULL) delete[] head->From;
+ if (head->FromNick != NULL) delete[] head->FromNick;
+ if (head->ReturnPath != NULL) delete[] head->ReturnPath;
+ if (head->ReturnPathNick != NULL) delete[] head->ReturnPathNick;
+ if (head->Subject != NULL) delete[] head->Subject;
+ if (head->Date != NULL) delete[] head->Date;
+ if (head->To != NULL) DeleteShortNames(head->To);
+ if (head->Cc != NULL) DeleteShortNames(head->Cc);
+ if (head->Bcc != NULL) DeleteShortNames(head->Bcc);
+ if (head->Body != NULL) delete[] head->Body;
}
void DeleteHeaderContent(struct CHeader *head)
{
- if (head->From!=NULL) delete[] head->From;
- if (head->FromNick!=NULL) delete[] head->FromNick;
- if (head->ReturnPath!=NULL) delete[] head->ReturnPath;
- if (head->ReturnPathNick!=NULL) delete[] head->ReturnPathNick;
- if (head->Subject!=NULL) delete[] head->Subject;
- if (head->Date!=NULL) delete[] head->Date;
- if (head->Body!=NULL) delete[] head->Body;
- if (head->To!=NULL) DeleteNames(head->To);
- if (head->Cc!=NULL) DeleteNames(head->Cc);
- if (head->Bcc!=NULL) DeleteNames(head->Bcc);
+ if (head->From != NULL) delete[] head->From;
+ if (head->FromNick != NULL) delete[] head->FromNick;
+ if (head->ReturnPath != NULL) delete[] head->ReturnPath;
+ if (head->ReturnPathNick != NULL) delete[] head->ReturnPathNick;
+ if (head->Subject != NULL) delete[] head->Subject;
+ if (head->Date != NULL) delete[] head->Date;
+ if (head->Body != NULL) delete[] head->Body;
+ if (head->To != NULL) DeleteNames(head->To);
+ if (head->Cc != NULL) DeleteNames(head->Cc);
+ if (head->Bcc != NULL) DeleteNames(head->Bcc);
}
void DeleteNames(PYAMN_MIMENAMES Names)
{
PYAMN_MIMENAMES Parser=Names,Old;
- for (;Parser!=NULL;Parser=Parser->Next)
+ for (;Parser != NULL;Parser=Parser->Next)
{
- if (Parser->Value!=NULL)
+ if (Parser->Value != NULL)
delete[] Parser->Value;
- if (Parser->ValueNick!=NULL)
+ if (Parser->ValueNick != NULL)
delete[] Parser->ValueNick;
Old=Parser;
Parser=Parser->Next;
@@ -483,11 +483,11 @@ void DeleteNames(PYAMN_MIMENAMES Names)
void DeleteShortNames(PYAMN_MIMESHORTNAMES Names)
{
PYAMN_MIMESHORTNAMES Parser=Names,Old;
- for (;Parser!=NULL;Parser=Parser->Next)
+ for (;Parser != NULL;Parser=Parser->Next)
{
- if (Parser->Value!=NULL)
+ if (Parser->Value != NULL)
delete[] Parser->Value;
- if (Parser->ValueNick!=NULL)
+ if (Parser->ValueNick != NULL)
delete[] Parser->ValueNick;
Old=Parser;
Parser=Parser->Next;
@@ -498,7 +498,7 @@ void DeleteShortNames(PYAMN_MIMESHORTNAMES Names)
void inline ToLower(char *string)
{
- for (;*string!=0;string++)
+ for (;*string != 0;string++)
if (*string>='A' && *string<='Z') *string=*string-'A'+'a';
}
@@ -539,7 +539,7 @@ void ParseAPart(APartDataType *data)
}
prev1=finder;
- while(*finder!=':' && !EOS(finder) && !ENDLINE(finder)) finder++;
+ while(*finder != ':' && !EOS(finder) && !ENDLINE(finder)) finder++;
if (ENDLINE(finder)||EOS(finder)) {
// no ":" in the line? here the body begins;
data->body = prev1;
@@ -631,7 +631,7 @@ WCHAR *ParseMultipartBody(char *src, char *bond)
}
if (partData[i].ContType) {
char *CharSetStr;
- if (NULL!=(CharSetStr=ExtractFromContentType(partData[i].ContType,"charset=")))
+ if (NULL != (CharSetStr=ExtractFromContentType(partData[i].ContType,"charset=")))
{
partData[i].CodePage=GetCharsetFromString(CharSetStr,strlen(CharSetStr));
delete[] CharSetStr;
@@ -658,7 +658,7 @@ WCHAR *ParseMultipartBody(char *src, char *bond)
} else if (partData[i].ContType && !_strnicmp(partData[i].ContType,"multipart/",10)) {
//Multipart in mulitipart recursive? should be SPAM. Ah well
char *bondary=NULL;
- if (NULL!=(bondary=ExtractFromContentType(partData[i].ContType,"boundary=")))
+ if (NULL != (bondary=ExtractFromContentType(partData[i].ContType,"boundary=")))
{
partData[i].wBody = ParseMultipartBody(partData[i].body,bondary);
delete[] bondary;
@@ -689,12 +689,12 @@ FailBackRaw:
_snprintf(infoline+linesize,sizeof(infoline)-linesize,"; %s",partData[i].ContType);
linesize = strlen(infoline);
partData[i].ContType=CharSetStr+1;
- if (NULL!=(CharSetStr=ExtractFromContentType(partData[i].ContType,"charset="))) {
+ if (NULL != (CharSetStr=ExtractFromContentType(partData[i].ContType,"charset="))) {
_snprintf(infoline+linesize,sizeof(infoline)-linesize,"; %s",CharSetStr);
linesize = strlen(infoline);
delete[] CharSetStr;
}
- if (NULL!=(CharSetStr=ExtractFromContentType(partData[i].ContType,"name="))) {
+ if (NULL != (CharSetStr=ExtractFromContentType(partData[i].ContType,"name="))) {
_snprintf(infoline+linesize,sizeof(infoline)-linesize,"; \"%s\"",CharSetStr);
linesize = strlen(infoline);
delete[] CharSetStr;
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index 8528d7d95f..1743199ba2 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -282,7 +282,7 @@ static void LoadPlugins()
hDllPlugins = NULL;
- if (INVALID_HANDLE_VALUE!=(hFind = FindFirstFile(szSearchPath, &fd))) {
+ if (INVALID_HANDLE_VALUE != (hFind = FindFirstFile(szSearchPath, &fd))) {
do {
//rewritten from Miranda sources... Needed because Win32 API has a bug in FindFirstFile, search is done for *.dlllllll... too
TCHAR *dot = _tcsrchr(fd.cFileName, '.');
@@ -294,7 +294,7 @@ static void LoadPlugins()
TCHAR* end = fd.cFileName+len; // get a pointer to the NULL
int safe = (end-dot)-1; // figure out how many chars after the dot are "safe", not including NULL
- if ((safe!=3) || (lstrcmpi(dot+1, _T("dll"))!=0)) //not bound, however the "dll" string should mean only 3 chars are compared
+ if ((safe != 3) || (lstrcmpi(dot+1, _T("dll")) != 0)) //not bound, however the "dll" string should mean only 3 chars are compared
continue;
HINSTANCE hDll;
@@ -340,7 +340,7 @@ extern "C" int __declspec(dllexport) Load(void)
else {
GetModuleFileName(GetModuleHandle(NULL), szMirandaDir, MAX_PATH);
TCHAR* str2 = _tcsrchr(szMirandaDir, '\\');
- if (str2!=NULL) *str2 = 0;
+ if (str2 != NULL) *str2 = 0;
}
// retrieve the current profile name
diff --git a/plugins/YAMN/src/proto/md5.c b/plugins/YAMN/src/proto/md5.c
deleted file mode 100644
index 280fcdeaae..0000000000
--- a/plugins/YAMN/src/proto/md5.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * This code implements the MD5 message-digest algorithm.
- * The algorithm is due to Ron Rivest. This code was
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * To compute the message digest of a chunk of bytes, declare an
- * MD5Context structure, pass it to MD5Init, call MD5Update as
- * needed on buffers full of bytes, and then call MD5Final, which
- * will fill a supplied 16-byte array with the digest.
- */
-//#include <string.h> /* for memcpy() */
-#if defined(_WIN64)
- typedef unsigned __int64 size_t;
-#else
- typedef unsigned int size_t;
-#endif
-void * __cdecl memcpy(void *, const void *, size_t);
-void * __cdecl memset(void *, int, size_t);
-#include "md5.h"
-
-#ifndef HIGHFIRST
-#define byteReverse(buf, len) /* Nothing */
-#else
-void byteReverse(unsigned char *buf, unsigned longs);
-
-#ifndef ASM_MD5
-/*
- * Note: this code is harmless on little-endian machines.
- */
-void byteReverse(unsigned char *buf, unsigned longs)
-{
- uint32 t;
- do {
- t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
- ((unsigned) buf[1] << 8 | buf[0]);
- *(uint32 *) buf = t;
- buf += 4;
- } while (--longs);
-}
-#endif
-#endif
-
-/*
- * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
- * initialization constants.
- */
-void MD5Init(struct MD5Context *ctx)
-{
- ctx->buf[0] = 0x67452301;
- ctx->buf[1] = 0xefcdab89;
- ctx->buf[2] = 0x98badcfe;
- ctx->buf[3] = 0x10325476;
-
- ctx->bits[0] = 0;
- ctx->bits[1] = 0;
-}
-
-/*
- * Update context to reflect the concatenation of another buffer full
- * of bytes.
- */
-void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
-{
- uint32 t;
-
- /* Update bitcount */
-
- t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
- ctx->bits[1]++; /* Carry from low to high */
- ctx->bits[1] += len >> 29;
-
- t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
-
- /* Handle any leading odd-sized chunks */
-
- if (t) {
- unsigned char *p = (unsigned char *) ctx->in + t;
-
- t = 64 - t;
- if (len < t) {
- memcpy(p, buf, len);
- return;
- }
- memcpy(p, buf, t);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
- buf += t;
- len -= t;
- }
- /* Process data in 64-byte chunks */
-
- while (len >= 64) {
- memcpy(ctx->in, buf, 64);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
- buf += 64;
- len -= 64;
- }
-
- /* Handle any remaining bytes of data. */
-
- memcpy(ctx->in, buf, len);
-}
-
-/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern
- * 1 0* (64-bit count of bits processed, MSB-first)
- */
-void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
-{
- unsigned count;
- unsigned char *p;
-
- /* Compute number of bytes mod 64 */
- count = (ctx->bits[0] >> 3) & 0x3F;
-
- /* Set the first char of padding to 0x80. This is safe since there is
- always at least one byte free */
- p = ctx->in + count;
- *p++ = 0x80;
-
- /* Bytes of padding needed to make 64 bytes */
- count = 64 - 1 - count;
-
- /* Pad out to 56 mod 64 */
- if (count < 8) {
- /* Two lots of padding: Pad the first block to 64 bytes */
- memset(p, 0, count);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
-
- /* Now fill the next block with 56 bytes */
- memset(ctx->in, 0, 56);
- } else {
- /* Pad block to 56 bytes */
- memset(p, 0, count - 8);
- }
- byteReverse(ctx->in, 14);
-
- /* Append length in bits and transform */
- ((uint32 *) ctx->in)[14] = ctx->bits[0];
- ((uint32 *) ctx->in)[15] = ctx->bits[1];
-
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
- byteReverse((unsigned char *) ctx->buf, 4);
- memcpy(digest, ctx->buf, 16);
- memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
-}
-
-#ifndef ASM_MD5
-
-/* The four core functions - F1 is optimized somewhat */
-
-/* #define F1(x, y, z) (x & y | ~x & z) */
-#define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
-#define F3(x, y, z) (x ^ y ^ z)
-#define F4(x, y, z) (y ^ (x | ~z))
-
-/* This is the central step in the MD5 algorithm. */
-#define MD5STEP(f, w, x, y, z, data, s) \
- ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
-
-/*
- * The core of the MD5 algorithm, this alters an existing MD5 hash to
- * reflect the addition of 16 longwords of new data. MD5Update blocks
- * the data and converts bytes into longwords for this routine.
- */
-void MD5Transform(uint32 buf[4], uint32 const in[16])
-{
- register uint32 a, b, c, d;
-
- a = buf[0];
- b = buf[1];
- c = buf[2];
- d = buf[3];
-
- MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
- MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
- MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
- MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
- MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
- MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
- MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
- MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
- MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
- MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
- MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
- MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
- MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
- MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
- MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
- MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
-
- MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
- MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
- MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
- MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
- MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
- MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
- MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
- MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
- MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
- MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
- MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
- MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
- MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
- MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
- MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
- MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
-
- MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
- MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
- MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
- MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
- MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
- MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
- MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
- MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
- MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
- MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
- MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
- MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
- MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
- MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
- MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
- MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
-
- MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
- MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
- MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
- MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
- MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
- MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
- MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
- MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
- MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
- MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
- MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
- MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
- MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
- MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
- MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
- MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
-
- buf[0] += a;
- buf[1] += b;
- buf[2] += c;
- buf[3] += d;
-}
-
-#endif
diff --git a/plugins/YAMN/src/proto/md5.h b/plugins/YAMN/src/proto/md5.h
deleted file mode 100644
index e264f686db..0000000000
--- a/plugins/YAMN/src/proto/md5.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef MD5_H
-#define MD5_H
-
-#ifdef __alpha
-typedef unsigned int uint32;
-#else
-typedef unsigned long uint32;
-#endif
-
-struct MD5Context {
- uint32 buf[4];
- uint32 bits[2];
- unsigned char in[64];
-};
-
-void MD5Init(struct MD5Context *context);
-void MD5Update(struct MD5Context *context, unsigned char const *buf,
- unsigned len);
-void MD5Final(unsigned char digest[16], struct MD5Context *context);
-void MD5Transform(uint32 buf[4], uint32 const in[16]);
-
-/*
- * This is needed to make RSAREF happy on some MS-DOS compilers.
- */
-typedef struct MD5Context MD5_CTX;
-
-#endif /* !MD5_H */
diff --git a/plugins/YAMN/src/proto/netlib.cpp b/plugins/YAMN/src/proto/netlib.cpp
index 652715d771..cfe3b20c48 100644
--- a/plugins/YAMN/src/proto/netlib.cpp
+++ b/plugins/YAMN/src/proto/netlib.cpp
@@ -151,7 +151,7 @@ void CNLClient::Send(const char *query) throw(DWORD)
#endif
try
{
- if ((SOCKET_ERROR==(Sent=LocalNetlib_Send(hConnection,query,(int)strlen(query),MSG_DUMPASTEXT))) || Sent!=(unsigned int)strlen(query))
+ if ((SOCKET_ERROR==(Sent=LocalNetlib_Send(hConnection,query,(int)strlen(query),MSG_DUMPASTEXT))) || Sent != (unsigned int)strlen(query))
{
SystemError=WSAGetLastError();
throw NetworkError=(DWORD)ENL_SEND;
diff --git a/plugins/YAMN/src/proto/pop3/pop3.cpp b/plugins/YAMN/src/proto/pop3/pop3.cpp
index 76c3e9645c..bae04363cb 100644
--- a/plugins/YAMN/src/proto/pop3/pop3.cpp
+++ b/plugins/YAMN/src/proto/pop3/pop3.cpp
@@ -28,10 +28,6 @@
#include "..\..\yamn.h"
#include "pop3.h"
-extern "C" {
-#include "../md5.h"
-}
-
extern void __stdcall SSL_DebugLog( const char *fmt, ... );
//--------------------------------------------------------------------------------------------------
@@ -47,7 +43,7 @@ char *CPop3Client::Connect(const char* servername,const int port,BOOL UseSSL, BO
if (Stopped) //check if we can work with this POP3 client session
throw POP3Error=(DWORD)EPOP3_STOPPED;
- if (NetClient!=NULL)
+ if (NetClient != NULL)
delete NetClient;
SSL=UseSSL;
NetClient=new CNLClient;
@@ -114,7 +110,7 @@ char* CPop3Client::RecvRest(char* prev,int mode,int size)
{ //if not found
if (NetClient->Stopped) //check if we can work with this POP3 client session
{
- if (PrevString!=NULL)
+ if (PrevString != NULL)
free(PrevString);
throw POP3Error=(DWORD)EPOP3_STOPPED;
}
@@ -252,13 +248,13 @@ char* CPop3Client::APOP(char* name, char* pw, char* timestamp)
if (timestamp==NULL)
throw POP3Error=(DWORD)EPOP3_APOP;
- MD5Context ctx;
- MD5Init(&ctx);
- MD5Update(&ctx,(const unsigned char *)timestamp,(unsigned int)strlen(timestamp));
- MD5Update(&ctx,(const unsigned char *)pw,(unsigned int)strlen(pw));
- MD5Final(digest,&ctx);
+ mir_md5_state_s ctx;
+ mir_md5_init(&ctx);
+ mir_md5_append(&ctx,(const unsigned char *)timestamp,(unsigned int)strlen(timestamp));
+ mir_md5_append(&ctx,(const unsigned char *)pw,(unsigned int)strlen(pw));
+ mir_md5_finish(&ctx, digest);
hexdigest[0]='\0';
- for (int i=0; i<16; i++) {
+ for (int i=0; i < 16; i++) {
char tmp[4];
sprintf(tmp, "%02x", digest[i]);
strcat(hexdigest, tmp);
diff --git a/plugins/YAMN/src/proto/pop3/pop3.h b/plugins/YAMN/src/proto/pop3/pop3.h
index 1f7f2ea737..4d49f80bec 100644
--- a/plugins/YAMN/src/proto/pop3/pop3.h
+++ b/plugins/YAMN/src/proto/pop3/pop3.h
@@ -23,7 +23,7 @@ class CPop3Client
{
public:
CPop3Client(): NetClient(NULL), Stopped(FALSE) {}
- ~CPop3Client() {if (NetClient!=NULL) delete NetClient;}
+ ~CPop3Client() {if (NetClient != NULL) delete NetClient;}
char* Connect(const char* servername,const int port=110,BOOL UseSSL=FALSE, BOOL NoTLS=FALSE);
char* RecvRest(char* prev,int mode,int size=65536);
diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp
index 2139a93375..7573484e8c 100644
--- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp
+++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp
@@ -157,7 +157,7 @@ CPOP3Account::CPOP3Account()
CPOP3Account::~CPOP3Account()
{
CloseHandle(UseInternetFree);
- if (InternetQueries!=NULL)
+ if (InternetQueries != NULL)
delete InternetQueries;
}
@@ -167,7 +167,7 @@ HACCOUNT WINAPI CreatePOP3Account(HYAMNPROTOPLUGIN Plugin,DWORD CAccountVersion)
//But this is internal plugin, so YAMN's CAccount structure and our CAccount structure are
//the same, so we do not need to test version. Otherwise, if CAccount version does not match
//in your plugin, you should return NULL, like this:
-// if (CAccountVersion!=YAMN_ACCOUNTVERSION) return NULL;
+// if (CAccountVersion != YAMN_ACCOUNTVERSION) return NULL;
//Now it is needed to construct our POP3 account and return its handle
return (HACCOUNT)new struct CPOP3Account();
@@ -181,7 +181,7 @@ void WINAPI DeletePOP3Account(HACCOUNT Which)
void WINAPI StopPOP3Account(HACCOUNT Which)
{
((HPOP3ACCOUNT)Which)->Client.Stopped=TRUE;
- if (((HPOP3ACCOUNT)Which)->Client.NetClient!=NULL) //we should inform also network client. Usefull only when network client implements this feature
+ if (((HPOP3ACCOUNT)Which)->Client.NetClient != NULL) //we should inform also network client. Usefull only when network client implements this feature
((HPOP3ACCOUNT)Which)->Client.NetClient->Stopped=TRUE;
}
@@ -263,7 +263,7 @@ int RegisterPOP3Plugin(WPARAM,LPARAM)
FileName = NULL;
return 0;
case EACC_SYSTEM:
- if (ERROR_FILE_NOT_FOUND!=GetLastError())
+ if (ERROR_FILE_NOT_FOUND != GetLastError())
{
TCHAR temp[1024] = {0};
mir_sntprintf(temp, SIZEOF(temp), _T("%s\n%s"),TranslateT("Reading file error. File already in use?"),FileName);
@@ -281,7 +281,7 @@ int RegisterPOP3Plugin(WPARAM,LPARAM)
DBVARIANT dbv;
char *szProto;
- for (Finder=POP3Plugin->FirstAccount;Finder!=NULL;Finder=Finder->Next)
+ for (Finder=POP3Plugin->FirstAccount;Finder != NULL;Finder=Finder->Next)
{
Finder->hContact = NULL;
hContact = db_find_first();
@@ -374,7 +374,7 @@ DWORD WINAPI ReadPOP3Options(HACCOUNT Which,char **Parser,char *End)
(*Parser)+=sizeof(DWORD);
if (*Parser>=End)
return EACC_FILECOMPATIBILITY;
- if (Ver!=POP3_FILEVERSION)
+ if (Ver != POP3_FILEVERSION)
return EACC_FILECOMPATIBILITY;
((HPOP3ACCOUNT)Which)->CP=*(WORD *)(*Parser);
@@ -395,7 +395,7 @@ HYAMNMAIL WINAPI CreatePOP3Mail(HACCOUNT Account,DWORD MailDataVersion)
//But this is internal plugin, so YAMN's MAILDATA structure and our MAILDATA structure are
//the same, so we do not need to test version. Otherwise, if MAILDATA version does not match
//in your plugin, you should return NULL, like this:
-// if (MailDataVersion!=YAMN_MAILDATAVERSION) return NULL;
+// if (MailDataVersion != YAMN_MAILDATAVERSION) return NULL;
//Now it is needed to construct our POP3 account and return its handle
if (NULL==(NewMail=new YAMNMAIL))
@@ -426,7 +426,7 @@ static void PostErrorProc(HPOP3ACCOUNT ActualAccount,void *ParamToBadConnection,
PPOP3_ERRORCODE ErrorCode;
//We store status before we do Quit(), because quit can destroy our errorcode status
- if (NULL!=(ErrorCode=new POP3_ERRORCODE))
+ if (NULL != (ErrorCode=new POP3_ERRORCODE))
{
ErrorCode->SSL=UseSSL;
ErrorCode->AppError=ActualAccount->SystemError;
@@ -440,7 +440,7 @@ static void PostErrorProc(HPOP3ACCOUNT ActualAccount,void *ParamToBadConnection,
try
{
DataRX=ActualAccount->Client.Quit();
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
}
catch(...)
@@ -502,7 +502,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
//First, we should compare our version of CheckParam structure, but here it is not needed, because YAMN and internal plugin
//have the same version. But your plugin should do that in this way:
- // if (((struct CheckParam *)WhichTemp)->Ver!=YAMN_CHECKVERSION)
+ // if (((struct CheckParam *)WhichTemp)->Ver != YAMN_CHECKVERSION)
// {
// SetEvent(((struct CheckParam *)WhichTemp)->ThreadRunningEV); //don't forget to unblock YAMN
// return (DWORD)-1; //ok, but we should return value.
@@ -519,13 +519,13 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
#endif
SCInc(ActualAccount->UsingThreads);
//Unblock YAMN, signal that we have copied all parameters from YAMN thread stack
- if (INVALID_HANDLE_VALUE!=WhichTemp->ThreadRunningEV)
+ if (INVALID_HANDLE_VALUE != WhichTemp->ThreadRunningEV)
SetEvent(WhichTemp->ThreadRunningEV);
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToRead(ActualAccount))
+ if (WAIT_OBJECT_0 != WaitToRead(ActualAccount))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountSO-read wait failed\n");
@@ -598,7 +598,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
DataRX=MyClient->Connect(ActualCopied.ServerName,ActualCopied.ServerPort,ActualCopied.Flags & YAMN_ACC_SSL23,ActualCopied.Flags & YAMN_ACC_NOTLS);
char *timestamp=NULL;
- if (DataRX!=NULL)
+ if (DataRX != NULL)
{
if (ActualCopied.Flags & YAMN_ACC_APOP)
{
@@ -620,17 +620,17 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
if (ActualCopied.Flags & YAMN_ACC_APOP)
{
DataRX=MyClient->APOP(ActualCopied.ServerLogin,ActualCopied.ServerPasswd,timestamp);
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
delete[] timestamp;
} else {
DataRX=MyClient->User(ActualCopied.ServerLogin);
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
DataRX=MyClient->Pass(ActualCopied.ServerPasswd);
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
}
@@ -649,7 +649,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
DebugLog(DecodeFile,"<Msgs>%d</Msgs>\n",msgs);
DebugLog(DecodeFile,"</Extracting stat>\n");
#endif
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
for (i=0;i<msgs;i++)
@@ -678,7 +678,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"</Extracting list>\n");
#endif
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
@@ -690,14 +690,14 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"</Extracting UIDL>\n");
#endif
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
}
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write wait\n");
#endif
- if (WAIT_OBJECT_0!=MsgsWaitToWrite(ActualAccount))
+ if (WAIT_OBJECT_0 != MsgsWaitToWrite(ActualAccount))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write wait failed\n");
@@ -708,10 +708,10 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write enter\n");
#endif
ActualAccount->LastChecked=now;
- for (MsgQueuePtr=(HYAMNMAIL)ActualAccount->Mails;MsgQueuePtr!=NULL;MsgQueuePtr=MsgQueuePtr->Next) {
+ for (MsgQueuePtr=(HYAMNMAIL)ActualAccount->Mails;MsgQueuePtr != NULL;MsgQueuePtr=MsgQueuePtr->Next) {
if (MsgQueuePtr->Flags&YAMN_MSG_BODYREQUESTED) {
HYAMNMAIL NewMsgsPtr=NULL;
- for (NewMsgsPtr=(HYAMNMAIL)NewMails;NewMsgsPtr!=NULL;NewMsgsPtr=NewMsgsPtr->Next) {
+ for (NewMsgsPtr=(HYAMNMAIL)NewMails;NewMsgsPtr != NULL;NewMsgsPtr=NewMsgsPtr->Next) {
if (!strcmp(MsgQueuePtr->ID,NewMsgsPtr->ID)) {
TCHAR accstatus[512];
wsprintf(accstatus,TranslateT("Reading body %s"),NewMsgsPtr->ID);
@@ -721,7 +721,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
DebugLog(DecodeFile,"<Reading body>\n");
DebugLog(DecodeFile,"<Header>%s</Header>\n",DataRX);
#endif
- if (DataRX!=NULL)
+ if (DataRX != NULL)
{
Temp=DataRX;
while((Temp<DataRX+MyClient->NetClient->Rcv) && (WS(Temp) || ENDLINE(Temp))) Temp++;
@@ -734,12 +734,12 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
continue;
//delete all the headers of the old mail MsgQueuePtr->MailData->TranslatedHeader
struct CMimeItem *TH = MsgQueuePtr->MailData->TranslatedHeader;
- if (TH) for (;MsgQueuePtr->MailData->TranslatedHeader!=NULL;)
+ if (TH) for (;MsgQueuePtr->MailData->TranslatedHeader != NULL;)
{
TH=TH->Next;
- if (MsgQueuePtr->MailData->TranslatedHeader->name!=NULL)
+ if (MsgQueuePtr->MailData->TranslatedHeader->name != NULL)
delete[] MsgQueuePtr->MailData->TranslatedHeader->name;
- if (MsgQueuePtr->MailData->TranslatedHeader->value!=NULL)
+ if (MsgQueuePtr->MailData->TranslatedHeader->value != NULL)
delete[] MsgQueuePtr->MailData->TranslatedHeader->value;
delete MsgQueuePtr->MailData->TranslatedHeader;
MsgQueuePtr->MailData->TranslatedHeader=TH;
@@ -753,7 +753,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
#endif
MsgQueuePtr->Flags|=YAMN_MSG_BODYRECEIVED;
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
break;
@@ -769,7 +769,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write done\n");
#endif
MsgsWriteDone(ActualAccount);
- for (MsgQueuePtr=(HYAMNMAIL)ActualAccount->Mails;MsgQueuePtr!=NULL;MsgQueuePtr=MsgQueuePtr->Next) {
+ for (MsgQueuePtr=(HYAMNMAIL)ActualAccount->Mails;MsgQueuePtr != NULL;MsgQueuePtr=MsgQueuePtr->Next) {
if ((MsgQueuePtr->Flags&YAMN_MSG_BODYREQUESTED) && (MsgQueuePtr->Flags&YAMN_MSG_BODYRECEIVED)) {
MsgQueuePtr->Flags&=~YAMN_MSG_BODYREQUESTED;
if (MsgQueuePtr->MsgWindow)
@@ -777,15 +777,15 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
}
}
- for (msgs=0,MsgQueuePtr=NewMails;MsgQueuePtr!=NULL;MsgQueuePtr=MsgQueuePtr->Next,msgs++); //get number of new mails
+ for (msgs=0,MsgQueuePtr=NewMails;MsgQueuePtr != NULL;MsgQueuePtr=MsgQueuePtr->Next,msgs++); //get number of new mails
try
{
TCHAR accstatus[512];
- for (i=0,MsgQueuePtr=NewMails;MsgQueuePtr!=NULL;i++)
+ for (i=0,MsgQueuePtr=NewMails;MsgQueuePtr != NULL;i++)
{
- BOOL autoretr = (ActualAccount->Flags & YAMN_ACC_BODY)!=0;
+ BOOL autoretr = (ActualAccount->Flags & YAMN_ACC_BODY) != 0;
DataRX=MyClient->Top(MsgQueuePtr->Number,autoretr?100:0);
wsprintf(accstatus,TranslateT("Reading new mail messages (%d%% done)"),100*i/msgs);
SetAccountStatus(ActualAccount,accstatus);
@@ -794,7 +794,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
DebugLog(DecodeFile,"<New mail>\n");
DebugLog(DecodeFile,"<Header>%s</Header>\n",DataRX);
#endif
- if (DataRX!=NULL)
+ if (DataRX != NULL)
{
Temp=DataRX;
while((Temp<DataRX+MyClient->NetClient->Rcv) && (WS(Temp) || ENDLINE(Temp))) Temp++;
@@ -821,7 +821,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
// CallService(MS_YAMN_FILTERMAIL,(WPARAM)ActualAccount,(LPARAM)MsgQueuePtr);
FilterMailSvc((WPARAM)ActualAccount,(LPARAM)MsgQueuePtr);
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
@@ -837,7 +837,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write wait\n");
#endif
- if (WAIT_OBJECT_0!=MsgsWaitToWrite(ActualAccount))
+ if (WAIT_OBJECT_0 != MsgsWaitToWrite(ActualAccount))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write wait failed\n");
@@ -872,7 +872,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
if (0==SCGetNumber(ActualAccount->InternetQueries))
{
DataRX=MyClient->Quit();
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
MyClient->NetClient->Disconnect();
@@ -898,8 +898,8 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
YAMN_MAILBROWSERPARAM Param={(HANDLE)0,ActualAccount,ActualCopied.NFlags,ActualCopied.NNFlags,YAMNParam};
if (CheckFlags & YAMN_FORCECHECK)
- Param.nnflags|=YAMN_ACC_POP; //if force check, show popup anyway and if mailbrowser was opened, do not close
- Param.nnflags|= YAMN_ACC_MSGP; //do not close browser if already open
+ Param.nnflags |= YAMN_ACC_POP; //if force check, show popup anyway and if mailbrowser was opened, do not close
+ Param.nnflags |= YAMN_ACC_MSGP; //do not close browser if already open
CallService(MS_YAMN_MAILBROWSER,(WPARAM)&Param,(LPARAM)YAMN_MAILBROWSERVERSION);
}
SetContactStatus(ActualAccount,ActualAccount->isCounting?ID_STATUS_ONLINE:ID_STATUS_OFFLINE);
@@ -936,7 +936,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
DeleteMIMEQueue(ActualAccount,NewMails);
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
switch(ActualAccount->SystemError)
@@ -994,7 +994,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
//First, we should compare our version of DeleteParam structure, but here it is not needed, because YAMN and internal plugin
//have the same version. But your plugin should do that in this way:
- // if (((struct DeleteParam *)WhichTemp)->Ver!=YAMN_DELETEVERSION)
+ // if (((struct DeleteParam *)WhichTemp)->Ver != YAMN_DELETEVERSION)
// {
// SetEvent(((struct DeleteParam *)WhichTemp)->ThreadRunningEV); //don't forget to unblock YAMN
// return (DWORD)-1; //ok, but we should return value.
@@ -1010,13 +1010,13 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
DebugLog(SynchroFile,"DeleteMailsPOP3:Incrementing \"using threads\" %x (account %x)\n",ActualAccount->UsingThreads,ActualAccount);
#endif
SCInc(ActualAccount->UsingThreads);
- if (INVALID_HANDLE_VALUE!=WhichTemp->ThreadRunningEV)
+ if (INVALID_HANDLE_VALUE != WhichTemp->ThreadRunningEV)
SetEvent(WhichTemp->ThreadRunningEV);
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"DeleteMailsPOP3:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToRead(ActualAccount))
+ if (WAIT_OBJECT_0 != WaitToRead(ActualAccount))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"DeleteMailsPOP3:ActualAccountSO-read wait failed\n");
@@ -1032,7 +1032,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
#endif
if (NULL==(DeleteMails=(HYAMNMAIL)CreateNewDeleteQueue((HYAMNMAIL)ActualAccount->Mails))) //if there's no mail for deleting, return
{
- if (POP3_DELETEFROMCHECK!=POP3PluginParam) //We do not wait for free internet when calling from SynchroPOP3. It is because UseInternetFree is blocked
+ if (POP3_DELETEFROMCHECK != POP3PluginParam) //We do not wait for free internet when calling from SynchroPOP3. It is because UseInternetFree is blocked
{
YAMN_MAILBROWSERPARAM Param={(HANDLE)0,ActualAccount,YAMN_ACC_MSGP,YAMN_ACC_MSGP,YAMNParam}; //Just update the window
@@ -1066,7 +1066,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
ReadDone(ActualAccount);
SCInc(ActualAccount->InternetQueries); //This is POP3-internal SCOUNTER, we set another thread wait for this account to be connected to inet
- if (POP3_DELETEFROMCHECK!=POP3PluginParam) //We do not wait for free internet when calling from SynchroPOP3. It is because UseInternetFree is blocked
+ if (POP3_DELETEFROMCHECK != POP3PluginParam) //We do not wait for free internet when calling from SynchroPOP3. It is because UseInternetFree is blocked
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"DeleteMailsPOP3:InternetFreeEV-wait\n");
@@ -1092,7 +1092,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
DataRX=MyClient->Connect(ActualCopied.ServerName,ActualCopied.ServerPort,ActualCopied.Flags & YAMN_ACC_SSL23,ActualCopied.Flags & YAMN_ACC_NOTLS);
char *timestamp=NULL;
- if (DataRX!=NULL) {
+ if (DataRX != NULL) {
if (ActualAccount->Flags & YAMN_ACC_APOP) {
char *lpos=strchr(DataRX,'<');
char *rpos=strchr(DataRX,'>');
@@ -1111,17 +1111,17 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
if (ActualAccount->Flags & YAMN_ACC_APOP)
{
DataRX=MyClient->APOP(ActualCopied.ServerLogin,ActualCopied.ServerPasswd,timestamp);
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
delete[] timestamp;
} else {
DataRX=MyClient->User(ActualCopied.ServerLogin);
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
DataRX=MyClient->Pass(ActualCopied.ServerPasswd);
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
}
@@ -1130,7 +1130,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<--------Deleting requested mails-------->\n");
#endif
- if (POP3_DELETEFROMCHECK!=POP3PluginParam) //We do not need to get mails on server as we have already it from check function
+ if (POP3_DELETEFROMCHECK != POP3PluginParam) //We do not need to get mails on server as we have already it from check function
{
SetAccountStatus(ActualAccount,TranslateT("Deleting requested mails"));
@@ -1145,7 +1145,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
DebugLog(DecodeFile,"<Msgs>%d</Msgs>\n",msgs);
DebugLog(DecodeFile,"</Extracting stat>\n");
#endif
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
for (i=0;i<msgs;i++)
@@ -1174,7 +1174,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"</Extracting UIDL>\n");
#endif
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
// we get "new mails" on server (NewMails will contain all mails on server not found in DeleteMails)
@@ -1187,7 +1187,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"DeleteMailsPOP3:ActualAccountMsgsSO-write wait\n");
#endif
- if (WAIT_OBJECT_0!=MsgsWaitToWrite(ActualAccount))
+ if (WAIT_OBJECT_0 != MsgsWaitToWrite(ActualAccount))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"DeleteMailsPOP3:ActualAccountMsgsSO-write wait failed\n");
@@ -1203,7 +1203,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
{
HYAMNMAIL Temp;
- for (i=0,MsgQueuePtr=DeleteMails;MsgQueuePtr!=NULL;i++)
+ for (i=0,MsgQueuePtr=DeleteMails;MsgQueuePtr != NULL;i++)
{
if (!(MsgQueuePtr->Flags & YAMN_MSG_VIRTUAL)) //of course we can only delete real mails, not virtual
{
@@ -1229,7 +1229,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
}
MsgQueuePtr=Temp;
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
}
@@ -1246,7 +1246,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
throw; //and go to the main exception handling
}
- if (NewMails!=NULL)
+ if (NewMails != NULL)
// in ActualAccount->Mails we have all mails stored before calling this function
// in NewMails we have all mails not found in DeleteMails (in other words: we performed new ID checking and we
// stored all mails found on server, then we deleted the ones we wanted to delete in this function
@@ -1255,7 +1255,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
SynchroMessages(ActualAccount,(HYAMNMAIL *)&ActualAccount->Mails,NULL,(HYAMNMAIL *)&NewMails,NULL);
// Now ActualAccount->Mails contains all mails when calling this function except the ones, we wanted to delete (these are in DeleteMails)
// And in NewMails we have new mails (if any)
- else if (POP3_DELETEFROMCHECK!=POP3PluginParam)
+ else if (POP3_DELETEFROMCHECK != POP3PluginParam)
{
DeleteMIMEQueue(ActualAccount,(HYAMNMAIL)ActualAccount->Mails);
ActualAccount->Mails=NULL;
@@ -1280,7 +1280,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
// if there is no waiting thread for internet connection close it
// else leave connection open
// if this functin was called from SynchroPOP3, then do not try to disconnect
- if (POP3_DELETEFROMCHECK!=POP3PluginParam)
+ if (POP3_DELETEFROMCHECK != POP3PluginParam)
{
YAMN_MAILBROWSERPARAM Param={(HANDLE)0,ActualAccount,ActualCopied.NFlags,YAMN_ACC_MSGP,YAMNParam};
@@ -1289,7 +1289,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
if (0==SCGetNumber(ActualAccount->InternetQueries))
{
DataRX=MyClient->Quit();
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
DataRX=NULL;
MyClient->NetClient->Disconnect();
@@ -1316,7 +1316,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
#ifdef DEBUG_COMM
DebugLog(CommFile,"ERROR %x\n",ErrorCode);
#endif
- if (DataRX!=NULL)
+ if (DataRX != NULL)
free(DataRX);
switch(ActualAccount->SystemError)
{
@@ -1328,7 +1328,7 @@ DWORD WINAPI DeleteMailsPOP3(struct DeleteParam *WhichTemp)
PostErrorProc(ActualAccount,YAMNParam,POP3PluginParam,MyClient->SSL); //it closes internet connection too
}
- if (UsingInternet && (POP3_DELETEFROMCHECK!=POP3PluginParam)) //if our thread still uses internet and it is needed to release internet
+ if (UsingInternet && (POP3_DELETEFROMCHECK != POP3PluginParam)) //if our thread still uses internet and it is needed to release internet
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:InternetFreeEV-done\n");
@@ -1364,11 +1364,11 @@ void ExtractStat(char *stream,int len,int *mboxsize,int *mails)
while(!WS(finder)) finder++;
while(WS(finder)) finder++;
}
- if (1!=sscanf(finder,"%d",mails))
+ if (1 != sscanf(finder,"%d",mails))
throw (DWORD)EPOP3_STAT;
while(!WS(finder)) finder++;
while(WS(finder)) finder++;
- if (1!=sscanf(finder,"%d",mboxsize))
+ if (1 != sscanf(finder,"%d",mboxsize))
throw (DWORD)EPOP3_STAT;
}
void ExtractMail(char *stream,int len,HYAMNMAIL queue)
@@ -1390,20 +1390,20 @@ void ExtractMail(char *stream,int len,HYAMNMAIL queue)
DebugLog(DecodeFile,"<Message>\n");
#endif
while(WS(finder)) finder++; //jump whitespace
- if (1!=sscanf(finder,"%d",&msgnr))
+ if (1 != sscanf(finder,"%d",&msgnr))
throw (DWORD)EPOP3_UIDL;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Nr>%d</Nr>\n",msgnr);
#endif
-// for (i=1,queueptr=queue;(queueptr->Next!=NULL) && (i<msgnr);queueptr=queueptr->Next,i++);
-// if (i!=msgnr)
+// for (i=1,queueptr=queue;(queueptr->Next != NULL) && (i<msgnr);queueptr=queueptr->Next,i++);
+// if (i != msgnr)
// throw (DWORD)EPOP3_UIDL;
while(!WS(finder)) finder++; //jump characters
while(WS(finder)) finder++; //jump whitespace
finderend=finder+1;
while(!WS(finderend) && !ENDLINE(finderend)) finderend++;
queueptr->ID=new char[finderend-finder+1];
- for (i=0;finder!=finderend;finder++,i++)
+ for (i=0;finder != finderend;finder++,i++)
queueptr->MailData->Body[i]=*finder;
queueptr->MailData->Body[i]=0; //ends string
queueptr->Number=msgnr;
@@ -1435,20 +1435,20 @@ void ExtractUIDL(char *stream,int len,HYAMNMAIL queue)
DebugLog(DecodeFile,"<Message>\n");
#endif
while(WS(finder)) finder++; //jump whitespace
- if (1!=sscanf(finder,"%d",&msgnr))
+ if (1 != sscanf(finder,"%d",&msgnr))
throw (DWORD)EPOP3_UIDL;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Nr>%d</Nr>\n",msgnr);
#endif
-// for (i=1,queueptr=queue;(queueptr->Next!=NULL) && (i<msgnr);queueptr=queueptr->Next,i++);
-// if (i!=msgnr)
+// for (i=1,queueptr=queue;(queueptr->Next != NULL) && (i<msgnr);queueptr=queueptr->Next,i++);
+// if (i != msgnr)
// throw (DWORD)EPOP3_UIDL;
while(!WS(finder)) finder++; //jump characters
while(WS(finder)) finder++; //jump whitespace
finderend=finder+1;
while(!WS(finderend) && !ENDLINE(finderend)) finderend++;
queueptr->ID=new char[finderend-finder+1];
- for (i=0;finder!=finderend;finder++,i++)
+ for (i=0;finder != finderend;finder++,i++)
queueptr->ID[i]=*finder;
queueptr->ID[i]=0; //ends string
queueptr->Number=msgnr;
@@ -1480,19 +1480,19 @@ void ExtractList(char *stream,int len,HYAMNMAIL queue)
DebugLog(DecodeFile,"<Message>\n",NULL,0);
#endif
while(WS(finder)) finder++; //jump whitespace
- if (1!=sscanf(finder,"%d",&msgnr)) //message nr.
+ if (1 != sscanf(finder,"%d",&msgnr)) //message nr.
throw (DWORD)EPOP3_LIST;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Nr>%d</Nr>\n",msgnr);
#endif
- for (i=1,queueptr=queue;(queueptr->Next!=NULL) && (i<msgnr);queueptr=queueptr->Next,i++);
- if (i!=msgnr)
+ for (i=1,queueptr=queue;(queueptr->Next != NULL) && (i<msgnr);queueptr=queueptr->Next,i++);
+ if (i != msgnr)
throw (DWORD)EPOP3_LIST;
while(!WS(finder)) finder++; //jump characters
while(WS(finder)) finder++; //jump whitespace
finderend=finder+1;
- if (1!=sscanf(finder,"%d",&queueptr->MailData->Size))
+ if (1 != sscanf(finder,"%d",&queueptr->MailData->Size))
throw (DWORD)EPOP3_LIST;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Nr>%d</Nr>\n",queueptr->MailData->Size);
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp
index f49033043b..5f0cf9230e 100644
--- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp
+++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp
@@ -96,7 +96,7 @@ INT_PTR CALLBACK DlgProcPluginOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam
break;
id=SendMessage(hCombo,CB_GETITEMDATA,(WPARAM)index,0);
EnterCriticalSection(&PluginRegCS);
- for (PParser=FirstProtoPlugin;PParser!=NULL;PParser=PParser->Next)
+ for (PParser=FirstProtoPlugin;PParser != NULL;PParser=PParser->Next)
if (id==(INT_PTR)PParser->Plugin)
{
SetDlgItemTextA(hDlg,IDC_STVER,PParser->Plugin->PluginInfo->Ver);
@@ -106,7 +106,7 @@ INT_PTR CALLBACK DlgProcPluginOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam
SetDlgItemTextA(hDlg,IDC_STWWW,PParser->Plugin->PluginInfo->WWW == NULL ? "" : PParser->Plugin->PluginInfo->WWW);
break;
}
- for (FParser=FirstFilterPlugin;FParser!=NULL;FParser=FParser->Next)
+ for (FParser=FirstFilterPlugin;FParser != NULL;FParser=FParser->Next)
if (id==(INT_PTR)FParser->Plugin)
{
SetDlgItemTextA(hDlg,IDC_STVER,FParser->Plugin->PluginInfo->Ver);
@@ -677,7 +677,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara
DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read enter\n");
#endif
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
+ for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
if (ActualAccount->Name != NULL)
SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
@@ -762,7 +762,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara
break;
case CBN_SELCHANGE:
- if (CB_ERR!=(Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
+ if (CB_ERR != (Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_GETLBTEXT,(WPARAM)Result,(LPARAM)DlgInput);
if ((Result==CB_ERR) || (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput)))) {
@@ -834,7 +834,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara
case IDC_CPFT:
case IDC_CPNB:
case IDC_CPNT:
- if (HIWORD(wParam)!=CPN_COLOURCHANGED)
+ if (HIWORD(wParam) != CPN_COLOURCHANGED)
break;
case IDC_CHECKKBN:
@@ -902,7 +902,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara
|| (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput))))
return TRUE;
- if (IDOK!=MessageBox(hDlg,TranslateT("Do you really want to delete this account?"),TranslateT("Delete account confirmation"),MB_OKCANCEL | MB_ICONWARNING))
+ if (IDOK != MessageBox(hDlg,TranslateT("Do you really want to delete this account?"),TranslateT("Delete account confirmation"),MB_OKCANCEL | MB_ICONWARNING))
return TRUE;
DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
@@ -1025,7 +1025,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToWrite(ActualAccount))
+ if (WAIT_OBJECT_0 != WaitToWrite(ActualAccount))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write wait failed\n");
@@ -1049,31 +1049,31 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara
strcpy(ActualAccount->Name,Text);
GetDlgItemTextA(hDlg,IDC_EDITSERVER,Text,sizeof(Text));
- if (NULL!=ActualAccount->Server->Name)
+ if (NULL != ActualAccount->Server->Name)
delete[] ActualAccount->Server->Name;
ActualAccount->Server->Name=new char[ strlen(Text)+1];
strcpy(ActualAccount->Server->Name,Text);
GetDlgItemTextA(hDlg,IDC_EDITLOGIN,Text,sizeof(Text));
- if (NULL!=ActualAccount->Server->Login)
+ if (NULL != ActualAccount->Server->Login)
delete[] ActualAccount->Server->Login;
ActualAccount->Server->Login=new char[ strlen(Text)+1];
strcpy(ActualAccount->Server->Login,Text);
GetDlgItemTextA(hDlg,IDC_EDITPASS,Text,sizeof(Text));
- if (NULL!=ActualAccount->Server->Passwd)
+ if (NULL != ActualAccount->Server->Passwd)
delete[] ActualAccount->Server->Passwd;
ActualAccount->Server->Passwd=new char[ strlen(Text)+1];
strcpy(ActualAccount->Server->Passwd,Text);
GetDlgItemTextW(hDlg,IDC_EDITAPP,TextW,SIZEOF(TextW));
- if (NULL!=ActualAccount->NewMailN.App)
+ if (NULL != ActualAccount->NewMailN.App)
delete[] ActualAccount->NewMailN.App;
ActualAccount->NewMailN.App=new WCHAR[wcslen(TextW)+1];
wcscpy(ActualAccount->NewMailN.App,TextW);
GetDlgItemTextW(hDlg,IDC_EDITAPPPARAM,TextW,SIZEOF(TextW));
- if (NULL!=ActualAccount->NewMailN.AppParam)
+ if (NULL != ActualAccount->NewMailN.AppParam)
delete[] ActualAccount->NewMailN.AppParam;
ActualAccount->NewMailN.AppParam=new WCHAR[wcslen(TextW)+1];
wcscpy(ActualAccount->NewMailN.AppParam,TextW);
@@ -1156,9 +1156,9 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara
HPOP3ACCOUNT temp = ActualAccount;
SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_RESETCONTENT,0,0);
- if (POP3Plugin->FirstAccount!=NULL)
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name!=NULL)
+ if (POP3Plugin->FirstAccount != NULL)
+ for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != NULL)
SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
ActualAccount = temp;
@@ -1198,9 +1198,9 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read enter\n");
#endif
- if (POP3Plugin->FirstAccount!=NULL)
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name!=NULL)
+ if (POP3Plugin->FirstAccount != NULL)
+ for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != NULL)
SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read done\n");
@@ -1228,9 +1228,9 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
HPOP3ACCOUNT temp = ActualAccount;
SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_RESETCONTENT,0,0);
- if (POP3Plugin->FirstAccount!=NULL)
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name!=NULL)
+ if (POP3Plugin->FirstAccount != NULL)
+ for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != NULL)
SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
ActualAccount = temp;
@@ -1279,7 +1279,7 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
}
break;
case CBN_SELCHANGE:
- if (CB_ERR!=(Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
+ if (CB_ERR != (Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_GETLBTEXT,(WPARAM)Result,(LPARAM)DlgInput);
if ((Result==CB_ERR) || (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput))))
{
@@ -1310,7 +1310,7 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa
case IDC_CPFT:
case IDC_CPNB:
case IDC_CPNT:
- if (HIWORD(wParam)!=CPN_COLOURCHANGED)
+ if (HIWORD(wParam) != CPN_COLOURCHANGED)
break;
case IDC_CHECKCOL:
case IDC_CHECKFCOL:
diff --git a/plugins/YAMN/src/protoplugin.cpp b/plugins/YAMN/src/protoplugin.cpp
index 479b54ce67..655ba4d238 100644
--- a/plugins/YAMN/src/protoplugin.cpp
+++ b/plugins/YAMN/src/protoplugin.cpp
@@ -51,7 +51,7 @@ INT_PTR RegisterProtocolPluginSvc(WPARAM wParam,LPARAM lParam)
PYAMN_PROTOREGISTRATION Registration=(PYAMN_PROTOREGISTRATION)wParam;
HYAMNPROTOPLUGIN Plugin;
- if (lParam!=YAMN_PROTOREGISTRATIONVERSION)
+ if (lParam != YAMN_PROTOREGISTRATIONVERSION)
return 0;
if ((Registration->Name==NULL) || (Registration->Ver==NULL))
return (INT_PTR)NULL;
@@ -78,9 +78,9 @@ int WINAPI SetProtocolPluginFcnImportFcn(HYAMNPROTOPLUGIN Plugin,PYAMN_PROTOIMPO
{
PYAMN_PROTOPLUGINQUEUE Parser;
- if (YAMNFcnVer!=YAMN_PROTOIMPORTFCNVERSION)
+ if (YAMNFcnVer != YAMN_PROTOIMPORTFCNVERSION)
return 0;
- if (YAMNMailFcnVer!=YAMN_MAILIMPORTFCNVERSION)
+ if (YAMNMailFcnVer != YAMN_MAILIMPORTFCNVERSION)
return 0;
if (YAMNFcn==NULL)
return 0;
@@ -95,7 +95,7 @@ int WINAPI SetProtocolPluginFcnImportFcn(HYAMNPROTOPLUGIN Plugin,PYAMN_PROTOIMPO
EnterCriticalSection(&PluginRegCS);
//We add protocol to the protocol list
- for (Parser=FirstProtoPlugin;Parser!=NULL && Parser->Next!=NULL;Parser=Parser->Next);
+ for (Parser=FirstProtoPlugin;Parser != NULL && Parser->Next != NULL;Parser=Parser->Next);
if (Parser==NULL)
{
FirstProtoPlugin=new YAMN_PROTOPLUGINQUEUE;
@@ -128,8 +128,8 @@ INT_PTR UnregisterProtocolPlugin(HYAMNPROTOPLUGIN Plugin)
}
else
{
- for (Parser=FirstProtoPlugin;(Parser->Next!=NULL) && (Plugin!=Parser->Next->Plugin);Parser=Parser->Next);
- if (Parser->Next!=NULL)
+ for (Parser=FirstProtoPlugin;(Parser->Next != NULL) && (Plugin != Parser->Next->Plugin);Parser=Parser->Next);
+ if (Parser->Next != NULL)
{
Found=Parser->Next;
Parser->Next=Parser->Next->Next;
@@ -137,11 +137,11 @@ INT_PTR UnregisterProtocolPlugin(HYAMNPROTOPLUGIN Plugin)
else
Found=NULL;
}
- if (Found!=NULL)
+ if (Found != NULL)
{
StopAccounts(Plugin);
DeleteAccounts(Plugin);
- if (Plugin->Fcn->UnLoadFcn!=NULL)
+ if (Plugin->Fcn->UnLoadFcn != NULL)
Plugin->Fcn->UnLoadFcn((void *)0);
delete Found->Plugin->AccountBrowserSO;
@@ -172,7 +172,7 @@ INT_PTR UnregisterProtoPlugins()
{
EnterCriticalSection(&PluginRegCS);
//We remove protocols from the protocol list
- while(FirstProtoPlugin!=NULL)
+ while(FirstProtoPlugin != NULL)
UnregisterProtocolPlugin(FirstProtoPlugin->Plugin);
LeaveCriticalSection(&PluginRegCS);
return 1;
diff --git a/plugins/YAMN/src/synchro.cpp b/plugins/YAMN/src/synchro.cpp
index e510d8bac9..84cc4cece0 100644
--- a/plugins/YAMN/src/synchro.cpp
+++ b/plugins/YAMN/src/synchro.cpp
@@ -88,13 +88,13 @@ void WINAPI SWMRGDelete(PSWMRG pSWMRG)
{
// Destroys any synchronization objects that were
// successfully created.
- if (NULL!=pSWMRG->hEventNoWriter)
+ if (NULL != pSWMRG->hEventNoWriter)
CloseHandle(pSWMRG->hEventNoWriter);
- if (NULL!=pSWMRG->hEventNoReaders)
+ if (NULL != pSWMRG->hEventNoReaders)
CloseHandle(pSWMRG->hEventNoReaders);
- if (NULL!=pSWMRG->hSemNumReaders)
+ if (NULL != pSWMRG->hSemNumReaders)
CloseHandle(pSWMRG->hSemNumReaders);
- if (NULL!=pSWMRG->hFinishEV)
+ if (NULL != pSWMRG->hFinishEV)
CloseHandle(pSWMRG->hFinishEV);
}
@@ -108,25 +108,25 @@ BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,TCHAR *Name)
// Creates the automatic-reset event that is signalled when
// no writer threads are writing.
// Initially no reader threads are reading.
- if (Name!=NULL)
+ if (Name != NULL)
Name[0]=(TCHAR)'W';
pSWMRG->hEventNoWriter=CreateEvent(NULL,FALSE,TRUE,Name);
// Creates the manual-reset event that is signalled when
// no reader threads are reading.
// Initially no reader threads are reading.
- if (Name!=NULL)
+ if (Name != NULL)
Name[0]=(TCHAR)'R';
pSWMRG->hEventNoReaders=CreateEvent(NULL,TRUE,TRUE,Name);
// Initializes the variable that indicates the number of
// reader threads that are reading.
// Initially no reader threads are reading.
- if (Name!=NULL)
+ if (Name != NULL)
Name[0]=(TCHAR)'C';
pSWMRG->hSemNumReaders=CreateSemaphore(NULL,0,0x7FFFFFFF,Name);
- if (Name!=NULL)
+ if (Name != NULL)
Name[0]=(TCHAR)'F';
pSWMRG->hFinishEV=CreateEvent(NULL,TRUE,FALSE,Name);
@@ -157,7 +157,7 @@ DWORD WINAPI SWMRGWaitToWrite(PSWMRG pSWMRG,DWORD dwTimeout)
return dw;
dw=WaitForMultipleObjects(2,aHandles,TRUE,dwTimeout);
// if a request to delete became later, we should not catch it. Try once more to ask if account is not about to delete
- if ((dw!=WAIT_FAILED) && (WAIT_OBJECT_0==(WaitForSingleObject(pSWMRG->hFinishEV,0))))
+ if ((dw != WAIT_FAILED) && (WAIT_OBJECT_0==(WaitForSingleObject(pSWMRG->hFinishEV,0))))
{
SetEvent(pSWMRG->hEventNoWriter);
return WAIT_FINISH;
@@ -196,7 +196,7 @@ DWORD WINAPI SWMRGWaitToRead(PSWMRG pSWMRG, DWORD dwTimeout)
return dw;
dw=WaitForSingleObject(pSWMRG->hEventNoWriter, dwTimeout);
// if a request to delete became later, we should not catch it. Try once more to ask if account is not about to delete
- if ((dw!=WAIT_FAILED) && (WAIT_OBJECT_0==(WaitForSingleObject(pSWMRG->hFinishEV,0))))
+ if ((dw != WAIT_FAILED) && (WAIT_OBJECT_0==(WaitForSingleObject(pSWMRG->hFinishEV,0))))
{
SetEvent(pSWMRG->hEventNoWriter);
return WAIT_FINISH;
@@ -261,7 +261,7 @@ DWORD WINAPI WaitToWriteFcn(PSWMRG SObject,PSCOUNTER SCounter)
DebugLog(SynchroFile,"\tSO WaitToWrite: %x\n",SObject);
#endif
if (WAIT_OBJECT_0==(EnterCode=SWMRGWaitToWrite(SObject,INFINITE)))
- if (SCounter!=NULL)
+ if (SCounter != NULL)
SCIncFcn(SCounter);
return EnterCode;
}
@@ -272,7 +272,7 @@ void WINAPI WriteDoneFcn(PSWMRG SObject,PSCOUNTER SCounter)
DebugLog(SynchroFile,"\tSO WriteDone: %x\n",SObject);
#endif
SWMRGDoneWriting(SObject);
- if (SCounter!=NULL)
+ if (SCounter != NULL)
SCDecFcn(SCounter);
}
diff --git a/plugins/YAMN/src/version.h b/plugins/YAMN/src/version.h
index e658cfee0c..8295e3260b 100644
--- a/plugins/YAMN/src/version.h
+++ b/plugins/YAMN/src/version.h
@@ -1,3 +1,3 @@
-#define YAMN_VERSION_H 0,1,2,5
-#define YAMN_VERSION PLUGIN_MAKE_VERSION( 0,1,2,5 )
-#define YAMN_VERSION_C "0.1.2.5"
+#define YAMN_VERSION_H 0,1,2,6
+#define YAMN_VERSION PLUGIN_MAKE_VERSION(0,1,2,6)
+#define YAMN_VERSION_C "0.1.2.6"
diff --git a/plugins/YAMN/src/yamn.cpp b/plugins/YAMN/src/yamn.cpp
index 3bc9d3929b..b50660e450 100644
--- a/plugins/YAMN/src/yamn.cpp
+++ b/plugins/YAMN/src/yamn.cpp
@@ -117,12 +117,12 @@ void CALLBACK TimerProc(HWND, UINT, UINT, DWORD)
Status=CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
EnterCriticalSection(&PluginRegCS);
- for (ActualPlugin=FirstProtoPlugin;ActualPlugin!=NULL;ActualPlugin=ActualPlugin->Next)
+ for (ActualPlugin=FirstProtoPlugin;ActualPlugin != NULL;ActualPlugin=ActualPlugin->Next)
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=SWMRGWaitToRead(ActualPlugin->Plugin->AccountBrowserSO, 0)) //we want to access accounts immiadtelly
+ if (WAIT_OBJECT_0 != SWMRGWaitToRead(ActualPlugin->Plugin->AccountBrowserSO, 0)) //we want to access accounts immiadtelly
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read enter failed\n");
@@ -133,14 +133,14 @@ void CALLBACK TimerProc(HWND, UINT, UINT, DWORD)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read enter\n");
#endif
- for (ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=ActualAccount->Next)
+ for (ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=ActualAccount->Next)
{
if (ActualAccount->Plugin==NULL || ActualAccount->Plugin->Fcn==NULL) //account not inited
continue;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=SWMRGWaitToRead(ActualAccount->AccountAccessSO, 0))
+ if (WAIT_OBJECT_0 != SWMRGWaitToRead(ActualAccount->AccountAccessSO, 0))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read wait failed\n");
@@ -239,7 +239,7 @@ ChangeIsCountingStatusLabel:
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read done\n");
#endif
- if (((ActualAccount->isCounting)!=0)!=isAccountCounting) {
+ if (((ActualAccount->isCounting) != 0) != isAccountCounting) {
ActualAccount->isCounting=isAccountCounting;
WORD cStatus = DBGetContactSettingWord(ActualAccount->hContact, YAMN_DBMODULE, "Status", 0);
switch (cStatus) {
@@ -275,7 +275,7 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM)
if (WAIT_OBJECT_0==WaitForSingleObject(ExitEV, 0))
return 0;
EnterCriticalSection(&PluginRegCS);
- for (ActualPlugin=FirstProtoPlugin;ActualPlugin!=NULL;ActualPlugin=ActualPlugin->Next)
+ for (ActualPlugin=FirstProtoPlugin;ActualPlugin != NULL;ActualPlugin=ActualPlugin->Next)
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "ForceCheck:AccountBrowserSO-read wait\n");
@@ -284,14 +284,14 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "ForceCheck:AccountBrowserSO-read enter\n");
#endif
- for (ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=ActualAccount->Next)
+ for (ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=ActualAccount->Next)
{
if (ActualAccount->Plugin->Fcn==NULL) //account not inited
continue;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=WaitToReadFcn(ActualAccount->AccountAccessSO))
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait failed\n");