summaryrefslogtreecommitdiff
path: root/plugins/StopSpamPlus
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-05-17 19:23:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-05-17 19:23:37 +0000
commit1d9fd398b75a5a6eca9d40db2e2abb60c96ebc7d (patch)
tree8d216553e534f6f34be4374741709aba73fc1739 /plugins/StopSpamPlus
parentc2914d5759e0ba8a3b9a81c8a1f071dba90094b4 (diff)
some more fixes for MS_DB_CONTACT_DELETE & loops
git-svn-id: http://svn.miranda-ng.org/main/trunk@4710 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StopSpamPlus')
-rw-r--r--plugins/StopSpamPlus/src/services.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp
index 43470f8de7..c6ea59fe31 100644
--- a/plugins/StopSpamPlus/src/services.cpp
+++ b/plugins/StopSpamPlus/src/services.cpp
@@ -22,19 +22,17 @@ INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/)
INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- DBVARIANT dbv = { 0 };
- if ( db_get_ts( hContact, "CList", "Group", &dbv ))
- dbv.ptszVal = NULL;
+ for (HANDLE hContact = db_find_first(); hContact; ) {
+ HANDLE 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 ) || (dbv.ptszVal != NULL && (_tcsstr(dbv.ptszVal, _T("Not In List")) || _tcsstr(dbv.ptszVal, 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 ) {
+ 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);
+ 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
db_set_b( hContact, "CList", "Delete", 1 );
@@ -44,7 +42,7 @@ INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam)
}
}
- db_free( &dbv );
+ hContact = hNext;
}
int hGroup = 1;