diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-04-09 05:26:46 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-04-09 05:26:46 +0300 |
commit | 8df2a03d555d4359185344774d20016ec4709308 (patch) | |
tree | 1957eaacd6c0b825dd17759e35514f519b84d8ca /stopspam.cpp | |
parent | 15ee16e4e22313487b6676bf24fd8e53bfe3a2d5 (diff) | |
parent | c0245a95c2bbe2e83a5514e6652ce483a70122ee (diff) |
Merge remote branch 'origin/stopspam_mod_elzor' into stopspam_mod
Diffstat (limited to 'stopspam.cpp')
-rw-r--r-- | stopspam.cpp | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/stopspam.cpp b/stopspam.cpp index 8ae8d47..ede14a6 100644 --- a/stopspam.cpp +++ b/stopspam.cpp @@ -81,7 +81,6 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) { HANDLE hContact = (HANDLE)w; DBEVENTINFO * dbei = (DBEVENTINFO*)l; - // if event is in protocol that is not despammed if(!ProtoInList(dbei->szModule)) @@ -164,16 +163,35 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // send congratulation if(msg) { + tstring prot=DBGetContactSettingStringPAN(NULL,dbei->szModule,"AM_BaseProto", _T("")); + // for notICQ protocols or disable auto auth. reqwest + if((Stricmp(_T("ICQ"),prot.c_str()))||(!gbAutoReqAuth)) + { #ifdef _UNICODE - char * buf=mir_utf8encodeW(variables_parse(gbCongratulation, hContact).c_str()); - CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)buf); - mir_free(buf); + char * buf=mir_utf8encodeW(variables_parse(gbCongratulation, hContact).c_str()); + CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)buf); + mir_free(buf); #else - CallContactService(hContact, PSS_MESSAGE, 0, (LPARAM)GetCongratulation().c_str()); + CallContactService(hContact, PSS_MESSAGE, 0, (LPARAM)GetCongratulation().c_str()); #endif + }; + // Note: For ANSI can be not work + if(!Stricmp(_T("ICQ"),prot.c_str())){ + // grand auth. + if(gbAutoAuth) + CallProtoService(dbei->szModule, "/GrantAuth", w, 0); + // add contact to server list and local group + if(gbAutoAddToServerList) + { + DBWriteContactSettingTString(hContact, "CList", "Group", gbAutoAuthGroup.c_str()); + CallProtoService(dbei->szModule, "/AddServerContact", w, 0); + DBDeleteContactSetting(hContact, "CList", "NotOnList"); + }; + // auto auth. reqwest with send congratulation + if(gbAutoReqAuth) + CallContactService(hContact,PSS_AUTHREQUEST,0, (LPARAM)variables_parse(gbCongratulation, hContact).c_str()); + } } - - // process the event return 0; } @@ -225,10 +243,11 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) DBWriteContactSettingTString(hContact, "CList", "Group", gbSpammersGroup.c_str()); DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1); - // save message from contact - dbei->flags |= DBEF_READ; - CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)dbei); - + // save first message from contact + if (DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0)<2){ + dbei->flags |= DBEF_READ; + CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)dbei); + }; // reject processing of the event return 1; } |