summaryrefslogtreecommitdiff
path: root/plugins/YAMN/src/proto
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/YAMN/src/proto
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/YAMN/src/proto')
-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
7 files changed, 106 insertions, 396 deletions
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: