diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-11 19:01:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-11 19:01:03 +0000 |
commit | 1925d3521846f4e6683d3d537cc41de9c9bd7250 (patch) | |
tree | 3f9bd6e5f557dc9eac040b078ededd5ee8e7870d /plugins/StopSpamPlus | |
parent | b63d67c92da0c420ee7c4f81b8ecdd3b8cfd132d (diff) |
"we don't need these variables" (c) Pink Floyd
git-svn-id: http://svn.miranda-ng.org/main/trunk@8101 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StopSpamPlus')
-rw-r--r-- | plugins/StopSpamPlus/src/services.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 917393d4a8..83c53c3e21 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -1,20 +1,21 @@ #include "headers.h"
-INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/)
+INT_PTR IsContactPassed(WPARAM hContact, LPARAM /*lParam*/)
{
- MCONTACT hContact = wParam;
- std::string proto = GetContactProto(hContact);
-
- if ( !plSets->ProtoDisabled( proto.c_str()))
+ char *szProto = GetContactProto(hContact);
+ if (szProto == NULL)
return CS_PASSED;
- if ( db_get_b(hContact, pluginName, answeredSetting, 0))
+ if (!plSets->ProtoDisabled(szProto))
return CS_PASSED;
- if ( !db_get_b(hContact, "CList", "NotOnList", 0) && db_get_w( hContact, proto.c_str(), "SrvGroupId", -1 ) != 1)
+ if (db_get_b(hContact, pluginName, answeredSetting, 0))
return CS_PASSED;
- if ( IsExistMyMessage(hContact))
+ if (!db_get_b(hContact, "CList", "NotOnList", 0) && db_get_w(hContact, szProto, "SrvGroupId", -1) != 1)
+ return CS_PASSED;
+
+ if (IsExistMyMessage(hContact))
return CS_PASSED;
return CS_NOTPASSED;
@@ -26,12 +27,12 @@ INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam) MCONTACT hNext = db_find_next(hContact);
ptrT szGroup( db_get_tsa( hContact, "CList", "Group"));
- if ( db_get_b(hContact, "CList", "NotOnList", 0) || db_get_b(hContact, "CList", "Hidden", 0 ) || (szGroup != NULL && (_tcsstr(szGroup, _T("Not In List")) || _tcsstr(szGroup, TranslateT("Not In List"))))) {
+ if (db_get_b(hContact, "CList", "NotOnList", 0) || db_get_b(hContact, "CList", "Hidden", 0) || (szGroup != NULL && (_tcsstr(szGroup, _T("Not In List")) || _tcsstr(szGroup, TranslateT("Not In List"))))) {
char *szProto = GetContactProto(hContact);
if (szProto != NULL) {
// Check if protocol uses server side lists
DWORD caps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
- if ( caps & PF1_SERVERCLIST ) {
+ if (caps & PF1_SERVERCLIST) {
int 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
|