summaryrefslogtreecommitdiff
path: root/stopspam/src/services.cpp
diff options
context:
space:
mode:
authormataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-26 15:41:10 +0000
committermataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-26 15:41:10 +0000
commitf04d64869f3b1de54fb343f28f955584780001b8 (patch)
tree5453dc10de3d980de79ffe019fa0b5fcb692a27d /stopspam/src/services.cpp
parent7aff1e4cb053394db57c2814d5fe1e6493e0cc75 (diff)
Project folders rename part 3
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@215 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'stopspam/src/services.cpp')
-rw-r--r--stopspam/src/services.cpp82
1 files changed, 0 insertions, 82 deletions
diff --git a/stopspam/src/services.cpp b/stopspam/src/services.cpp
deleted file mode 100644
index fbfb82e..0000000
--- a/stopspam/src/services.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "../headers.h"
-
-INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/)
-{
- HANDLE hContact = ( HANDLE )wParam;
- std::string proto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
-
- if ( !plSets->ProtoDisabled( proto.c_str()))
- return CS_PASSED;
-
- if ( DBGetContactSettingByte( hContact, pluginName, answeredSetting, 0 ))
- return CS_PASSED;
-
- if ( !DBGetContactSettingByte( hContact, "CList", "NotOnList", 0) && DBGetContactSettingWord( hContact, proto.c_str(), "SrvGroupId", -1 ) != 1 )
- return CS_PASSED;
-
- if ( IsExistMyMessage( hContact ))
- return CS_PASSED;
-
- return CS_NOTPASSED;
-}
-
-INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam)
-{
- HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
- while ( hContact ) {
- HANDLE hNext = (HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM )hContact, 0 );
-
- DBVARIANT dbv = { 0 };
- if ( DBGetContactSettingTString( hContact, "CList", "Group", &dbv ))
- dbv.ptszVal = NULL;
-
- if ( DBGetContactSettingByte( hContact, "CList", "NotOnList", 0 ) || lstrcmp(dbv.ptszVal, _T("Not In List")) == 0 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0 )) {
- char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if ( szProto != NULL ) {
- // Check if protocol uses server side lists
- DWORD caps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
- if ( caps & PF1_SERVERCLIST ) {
- int status;
- status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
- if (status == ID_STATUS_OFFLINE || (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES))
- // Set a flag so we remember to delete the contact when the protocol goes online the next time
- DBWriteContactSettingByte( hContact, "CList", "Delete", 1 );
- else
- CallService( MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0 );
- }
- }
- }
-
- DBFreeVariant( &dbv );
- hContact = hNext;
- }
-
- int hGroup = 1;
- char *group_name;
- do {
- group_name = (char *)CallService(MS_CLIST_GROUPGETNAME, (WPARAM)hGroup, 0);
- if ( group_name && lstrcmpA(group_name, "Not In List") == 0 ) {
- BYTE ConfirmDelete = DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT);
- if ( ConfirmDelete )
- DBWriteContactSettingByte( NULL, "CList", "ConfirmDelete", 0 );
-
- CallService( MS_CLIST_GROUPDELETE, (WPARAM)hGroup, 0 );
- if ( ConfirmDelete )
- DBWriteContactSettingByte( NULL, "CList", "ConfirmDelete", ConfirmDelete );
- break;
- }
- hGroup++;
- }
- while( group_name );
- if (!lParam)
- MessageBox(NULL, TranslateT("Complete"), TranslateT(pluginName), MB_ICONINFORMATION);
-
- return 0;
-}
-
-int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam)
-{
- if (plSets->RemTmpAll.Get())
- RemoveTempContacts(0,1);
- return 0;
-}