diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
commit | 78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch) | |
tree | 8512c50df70b8dd80c919e88ade3419207c95956 /plugins/YAMN/filter | |
parent | ce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff) |
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAMN/filter')
-rw-r--r-- | plugins/YAMN/filter/Base/maindll.cpp | 14 | ||||
-rw-r--r-- | plugins/YAMN/filter/Simple/maindll.cpp | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/plugins/YAMN/filter/Base/maindll.cpp b/plugins/YAMN/filter/Base/maindll.cpp index 6affd00372..d6a645bd14 100644 --- a/plugins/YAMN/filter/Base/maindll.cpp +++ b/plugins/YAMN/filter/Base/maindll.cpp @@ -87,7 +87,7 @@ extern "C" int __declspec(dllexport) LoadFilter(MIRANDASERVICE GetYAMNFcnPtr) InitDebug();
#endif
- if(!LoadRules())
+ if (!LoadRules())
return 0;
pYAMNFcn->RegisterFilterPlugin=(MIRANDASERVICE)GetYAMNFcnPtr((WPARAM)MS_YAMN_REGISTERFILTERPLUGIN,(LPARAM)0);
@@ -96,7 +96,7 @@ extern "C" int __declspec(dllexport) LoadFilter(MIRANDASERVICE GetYAMNFcnPtr) if(NULL==(POPFilePlugin=(HYAMNFILTERPLUGIN)pYAMNFcn->RegisterFilterPlugin((WPARAM)&FilterRegistration,(LPARAM)YAMN_FILTERREGISTRATIONVERSION)))
return 0;
//And add our imported functions for YAMN
- if(!pYAMNFcn->SetFilterPluginFcnImportFcn(POPFilePlugin,0xb0000000,&FilterFunctions,YAMN_FILTERIMPORTFCNVERSION))
+ if (!pYAMNFcn->SetFilterPluginFcnImportFcn(POPFilePlugin,0xb0000000,&FilterFunctions,YAMN_FILTERIMPORTFCNVERSION))
return 0;
return 1; //Load luccess
}
@@ -136,28 +136,28 @@ DWORD WINAPI FilterMail(HACCOUNT Account,DWORD AccountVer,HYAMNMAIL Mail,DWORD M #ifdef DEBUG_FILTER
DebugLog(FilterFile,"<New mail>\n");
#endif
- if(!(Mail->Flags & YAMN_MSG_VIRTUAL))
+ if (!(Mail->Flags & YAMN_MSG_VIRTUAL))
for(Browser=Mail->MailData->TranslatedHeader;Browser!=NULL;Browser=Browser->Next) //we browse all header stored in Mail->TranslatedHeader
{
#ifdef DEBUG_FILTER
DebugLog(FilterFile,"<Testing header item %s: %s>\n",Browser->name,Browser->value);
#endif
for(int i=0;i<fts;i++)
- if(!lstrcmpi(Browser->name,ft[i].name))
+ if (!lstrcmpi(Browser->name,ft[i].name))
{
#ifdef DEBUG_FILTER
DebugLog(FilterFile,"\t\t<Found appropriate selector %s>\n",Browser->name);
#endif
if(findsubstr(Browser->value,ft[i].value)) //and if we find
{
- if((ft[i].sl==0) && ((Mail->Flags & YAMN_MSG_SPAMMASK)==0))
+ if ((ft[i].sl==0) && ((Mail->Flags & YAMN_MSG_SPAMMASK)==0))
{
Mail->Flags&=~(YAMN_MSG_POPUP | YAMN_MSG_SYSTRAY | YAMN_MSG_BROWSER | YAMN_MSG_SOUND | YAMN_MSG_APP | YAMN_MSG_NEVENT);
#ifdef DEBUG_FILTER
DebugLog(FilterFile,"\t\tSetting individual flags not to notify mail, but does not consider as spam.");
#endif
}
- else if((Mail->Flags & YAMN_MSG_SPAMMASK) < ft[i].sl) //if some filter plugin set higher level of spam, we do nothing
+ else if ((Mail->Flags & YAMN_MSG_SPAMMASK) < ft[i].sl) //if some filter plugin set higher level of spam, we do nothing
{
Mail->Flags=(Mail->Flags & ~YAMN_MSG_SPAMMASK)+ft[i].sl; //else we set spam level 2 (clearing spam bits and then settting them to level 2
#ifdef DEBUG_FILTER
@@ -232,7 +232,7 @@ int findsubstr(char *original,char *pattern) int pl=lstrlen(pattern);
for(int i=0;(i+pl)<=ol;i++)
- if(!_strnicmp(original+i,pattern,pl))
+ if (!_strnicmp(original+i,pattern,pl))
return 1;
return 0;
}
\ No newline at end of file diff --git a/plugins/YAMN/filter/Simple/maindll.cpp b/plugins/YAMN/filter/Simple/maindll.cpp index 77488352b9..62aa87b28d 100644 --- a/plugins/YAMN/filter/Simple/maindll.cpp +++ b/plugins/YAMN/filter/Simple/maindll.cpp @@ -67,7 +67,7 @@ extern "C" int __declspec(dllexport) LoadFilter(MIRANDASERVICE GetYAMNFcnPtr) if(NULL==(POPFilePlugin=(HYAMNFILTERPLUGIN)pYAMNFcn->RegisterFilterPlugin((WPARAM)&FilterRegistration,(LPARAM)YAMN_FILTERREGISTRATIONVERSION)))
return 0;
//And add our imported functions for YAMN
- if(!pYAMNFcn->SetFilterPluginFcnImportFcn(POPFilePlugin,0xb0000000,&FilterFunctions,YAMN_FILTERIMPORTFCNVERSION))
+ if (!pYAMNFcn->SetFilterPluginFcnImportFcn(POPFilePlugin,0xb0000000,&FilterFunctions,YAMN_FILTERIMPORTFCNVERSION))
return 0;
return 1; //Load luccess
}
@@ -105,21 +105,21 @@ DWORD WINAPI FilterMail(HACCOUNT Account,DWORD AccountVer,HYAMNMAIL Mail,DWORD M return 0;
fp=fopen(FilterPath,"rt");
if(fp != NULL) {
- if(!(Mail->Flags & YAMN_MSG_VIRTUAL))
+ if (!(Mail->Flags & YAMN_MSG_VIRTUAL))
for(Browser=Mail->MailData->TranslatedHeader;Browser!=NULL;Browser=Browser->Next) { //we browse all header stored in Mail->TranslatedHeader
- if((!lstrcmp(Browser->name,"Return-Path")) || (!lstrcmp(Browser->name,"From"))) { //and if we find
+ if ((!lstrcmp(Browser->name,"Return-Path")) || (!lstrcmp(Browser->name,"From"))) { //and if we find
fseek(fp, 0L, SEEK_SET);
while(!feof(fp)) {
if(fscanf(fp, "%255s", EmailSpam) != 0) {
- if(!feof(fp))
+ if (!feof(fp))
if(fscanf(fp, "%d", &spamLevel)==0)
spamLevel=2;
if(spamLevel>4)
spamLevel=2;
if(strstr(Browser->value,EmailSpam)!=NULL) {
- if((Mail->Flags & (YAMN_MSG_SPAMMASK==0)) && (spamLevel==0))
+ if ((Mail->Flags & (YAMN_MSG_SPAMMASK==0)) && (spamLevel==0))
Mail->Flags&=~(YAMN_MSG_SOUND | YAMN_MSG_APP | YAMN_MSG_POPUP | YAMN_MSG_SYSTRAY | YAMN_MSG_BROWSER);
- else if((Mail->Flags & YAMN_MSG_SPAMMASK) < spamLevel) //if some filter plugin set higher level of spam, we do nothing
+ else if ((Mail->Flags & YAMN_MSG_SPAMMASK) < spamLevel) //if some filter plugin set higher level of spam, we do nothing
Mail->Flags=(Mail->Flags & ~YAMN_MSG_SPAMMASK)+spamLevel; //else we set spam level 2 (clearing spam bits and then settting them to level 2
}
}
|