diff options
author | Sergey (Elzor) Bolhovskoy <elzor@foobar2000.ru> | 2010-04-09 18:36:59 +0600 |
---|---|---|
committer | Sergey (Elzor) Bolhovskoy <elzor@foobar2000.ru> | 2010-04-09 18:36:59 +0600 |
commit | 3556a322f43327213a4331ceb2a8cd0b1981742f (patch) | |
tree | 787eebef181bb31ef4ab408529ac7c4b01ca236b | |
parent | 0ca67c83159c2001074b8ff303cc795daebe6ef1 (diff) | |
parent | 6ea93234f4190fec5234f79855455949626d0805 (diff) |
Merge branch 'stopspam_mod' into stopspam_mod_elzor
-rw-r--r-- | init.cpp | 4 | ||||
-rw-r--r-- | stopspam.cpp | 9 | ||||
-rw-r--r-- | stopspam.rc | 15 | ||||
-rw-r--r-- | utilities.cpp | 21 | ||||
-rw-r--r-- | utilities.h | 1 |
5 files changed, 38 insertions, 12 deletions
@@ -50,11 +50,11 @@ UTF8_INTERFACE utfi; PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), 0, - PLUGIN_MAKE_VERSION(0, 0, 1, 7), + PLUGIN_MAKE_VERSION(0, 0, 1, 8), pluginDescription, "Roman Miklashevsky", "sss123next@list.ru", - "© 2004-2009 Roman Miklashevsky, A. Petkevich, Kosh&chka, sss", + "© 2004-2009 Roman Miklashevsky, A. Petkevich, Kosh&chka, sss, Elzor", "http://sss.chaoslab.ru:81/tracker/mim_plugs/", UNICODE_AWARE, 0, diff --git a/stopspam.cpp b/stopspam.cpp index ede14a6..f029665 100644 --- a/stopspam.cpp +++ b/stopspam.cpp @@ -33,6 +33,11 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) { HANDLE hcntct; hcntct=*((PHANDLE)(dbei.pBlob+sizeof(DWORD))); + DBEVENTGETTEXT egt = {0}; + egt.datatype = DBVT_TCHAR; + egt.dbei = &dbei; + TCHAR *EventText = (TCHAR*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&egt); + // if request is from unknown or not marked Answered contact @@ -48,7 +53,9 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) DBWriteContactSettingByte(hcntct, "CList", "Hidden", 1); if(gbSpecialGroup) DBWriteContactSettingTString(hcntct, "CList", "Group", gbSpammersGroup.c_str()); - + if(gbIgnoreURL) + if(Stristr(EventText, _T("http")) || Stristr(EventText, _T("www")) || Stristr(EventText, _T(".ru")) || Stristr(EventText, _T(".com")) || Stristr(EventText, _T(".de")) || Stristr(EventText, _T(".cz")) || Stristr(EventText, _T(".org")) || Stristr(EventText, _T(".net")) || Stristr(EventText, _T(".su"))) + return 1; BYTE msg = 1; if(gbInvisDisable) { diff --git a/stopspam.rc b/stopspam.rc index 42879d9..e7ee6b8 100644 --- a/stopspam.rc +++ b/stopspam.rc @@ -13,7 +13,7 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// русский resources +// Russian resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) #ifdef _WIN32 @@ -91,7 +91,8 @@ BEGIN CONTROL "Add contacts to specified group:",ID_SPECIALGROUP, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,16,196,10 EDITTEXT ID_SPECIALGROUPNAME,217,15,79,12,ES_AUTOHSCROLL - CONTROL "Ignore URL in messages",ID_IGNOREURL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,88,287,10 + CONTROL "Ignore URL in messages and auth requests",ID_IGNOREURL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,88,287,10 CONTROL "Add contact to server list",IDC_ADDTOSRVLST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,114,187,10 EDITTEXT IDC_AUTOADDGROUP,210,112,76,14,ES_AUTOHSCROLL GROUPBOX "After congratulation (ICQ only)",IDC_STATIC,15,103,278,51 @@ -151,7 +152,7 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,1,7 + FILEVERSION 0,0,1,8 PRODUCTVERSION 0,7,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG @@ -170,7 +171,7 @@ BEGIN VALUE "Comments", "Licensed under the terms of the GNU General Public License" VALUE "CompanyName", " " VALUE "FileDescription", "StopSpam plugin for Miranda IM" - VALUE "FileVersion", "0.0.1.7" + VALUE "FileVersion", "0.0.1.8" VALUE "InternalName", "stopspam" VALUE "LegalCopyright", "Copyright © 2000-2009 Miranda IM Project. This software is released under the terms of the GNU General Public License." VALUE "OriginalFilename", "stopspam.dll" @@ -184,12 +185,12 @@ BEGIN END END -#endif // русский resources +#endif // Russian resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// английский (США) resources +// English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 @@ -222,7 +223,7 @@ END #endif // APSTUDIO_INVOKED -#endif // английский (США) resources +#endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/utilities.cpp b/utilities.cpp index 4d3b3cf..bf61929 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -144,12 +144,12 @@ tstring variables_parse(tstring const &tstrFormat, HANDLE hContact){ return tstrFormat; } -// case-insensitive _tcsstr +// case-insensitive _tcscmp //by nullbie as i remember... #define NEWTSTR_MALLOC(A) (A==NULL)?NULL:_tcscpy((TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(A)+1)),A) const int Stricmp(const TCHAR *str, const TCHAR *substr) { - int i; + int i = 0; TCHAR *str_up = NEWTSTR_MALLOC(str); TCHAR *substr_up = NEWTSTR_MALLOC(substr); @@ -164,3 +164,20 @@ const int Stricmp(const TCHAR *str, const TCHAR *substr) return i; } +const int Stristr(const TCHAR *str, const TCHAR *substr) +{ + int i = 0; + TCHAR *str_up = NEWTSTR_MALLOC(str); + TCHAR *substr_up = NEWTSTR_MALLOC(substr); + + CharUpperBuff(str_up, lstrlen(str_up)); + CharUpperBuff(substr_up, lstrlen(substr_up)); + + if(_tcsstr (str_up, substr_up)) + i = 1; + + mir_free(str_up); + mir_free(substr_up); + + return i; +} diff --git a/utilities.h b/utilities.h index 04866f7..ae57e0d 100644 --- a/utilities.h +++ b/utilities.h @@ -6,3 +6,4 @@ bool ProtoInList(std::string proto); void RemoveExcludedUsers(); tstring variables_parse(tstring const &tstrFormat, HANDLE hContact); const int Stricmp(const TCHAR *str, const TCHAR *substr); +const int Stristr(const TCHAR *str, const TCHAR *substr); |