diff options
Diffstat (limited to 'plugins/StopSpamPlus')
-rw-r--r-- | plugins/StopSpamPlus/src/events.cpp | 10 | ||||
-rw-r--r-- | plugins/StopSpamPlus/src/services.cpp | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index a854f547a0..4b3d6cd040 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -23,7 +23,7 @@ int OnDbEventAdded(WPARAM, LPARAM lParam) // if request is from unknown or not marked Answered contact
//and if I don't sent message to this contact
- if (db_get_b(hcntct, "CList", "NotOnList", 0) && !g_plugin.getByte(hcntct, DB_KEY_ANSWERED) && !IsExistMyMessage(hcntct)) {
+ if (!Contact_OnList(hcntct) && !g_plugin.getByte(hcntct, DB_KEY_ANSWERED) && !IsExistMyMessage(hcntct)) {
if (!g_sets.HandleAuthReq) {
char *buf = mir_utf8encodeW(variables_parse(g_sets.getReply(), hcntct).c_str());
ProtoChainSend(hcntct, PSS_MESSAGE, 0, (LPARAM)buf);
@@ -33,7 +33,7 @@ int OnDbEventAdded(WPARAM, LPARAM lParam) // ...send message
CallProtoService(dbei.szModule, PS_AUTHDENY, hDbEvent, (LPARAM)_T2A(variables_parse(g_sets.getReply(), hcntct).c_str()));
- db_set_b(hcntct, "CList", "NotOnList", 1);
+ Contact_RemoveFromList(hcntct);
Contact_Hide(hcntct);
if (!g_sets.HistLog)
db_event_delete(0, hDbEvent);
@@ -67,7 +67,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) // checking if message from self-added contact
//Contact in Not in list icq group
- if (!db_get_b(hContact, "CList", "NotOnList", 0) && db_get_w(hContact, dbei->szModule, "SrvGroupId", -1) != 1)
+ if (Contact_OnList(hContact) && db_get_w(hContact, dbei->szModule, "SrvGroupId", -1) != 1)
return 0;
//if I sent message to this contact
@@ -112,7 +112,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) //add contact permanently
if (g_sets.AddPermanent)
- db_unset(hContact, "CList", "NotOnList");
+ Contact_PutOnList(hContact);
// send congratulation
@@ -146,7 +146,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) }
// hide contact from contact list
- db_set_b(hContact, "CList", "NotOnList", 1);
+ Contact_RemoveFromList(hContact);
Contact_Hide(hContact);
// save message from contact
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 05fd78bc3d..de73b2b6e8 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -12,7 +12,7 @@ INT_PTR IsContactPassed(WPARAM hContact, LPARAM /*lParam*/) if (g_plugin.getByte(hContact, DB_KEY_ANSWERED))
return CS_PASSED;
- if (!db_get_b(hContact, "CList", "NotOnList", 0) && db_get_w(hContact, szProto, "SrvGroupId", -1) != 1)
+ if (Contact_OnList(hContact) && db_get_w(hContact, szProto, "SrvGroupId", -1) != 1)
return CS_PASSED;
if (IsExistMyMessage(hContact))
@@ -27,7 +27,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam) MCONTACT hNext = db_find_next(hContact);
ptrW szGroup(Clist_GetGroup(hContact));
- if (db_get_b(hContact, "CList", "NotOnList", 0) || (szGroup != NULL && (wcsstr(szGroup, L"Not In List") || wcsstr(szGroup, TranslateT("Not In List"))))) {
+ if (!Contact_OnList(hContact) || (szGroup != NULL && (wcsstr(szGroup, L"Not In List") || wcsstr(szGroup, TranslateT("Not In List"))))) {
char *szProto = GetContactProto(hContact);
if (szProto != nullptr) {
// Check if protocol uses server side lists
|