From 88171633a72848344976dd5d2ad4f4f0b13d75c4 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 4 Dec 2010 15:45:20 +0200 Subject: modified: utilities.cpp --- utilities.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index b12eba4..19c2d79 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -391,9 +391,11 @@ void CleanProtocolTmpThread(std::string proto) std::list contacts; for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) { - if(!strcmp(proto.c_str(), (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0))) - if(DBGetContactSettingByte(hContact, "CList", "NotOnList", 0)|| (_T("Not In List")== DBGetContactSettingStringPAN(hContact,"CList","Group",_T("")))) - contacts.push_back(hContact); + char *proto_tmp = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + if(proto_tmp) + if(!strcmp(proto.c_str(), proto_tmp)) + if(DBGetContactSettingByte(hContact, "CList", "NotOnList", 0)|| (_T("Not In List")== DBGetContactSettingStringPAN(hContact,"CList","Group",_T("")))) + contacts.push_back(hContact); } boost::this_thread::sleep(boost::posix_time::seconds(5)); clean_mutex.lock(); @@ -419,9 +421,11 @@ void CleanProtocolExclThread(std::string proto) std::list contacts; for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) { - if(!strcmp(proto.c_str(), (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0))) - if(DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && DBGetContactSettingByte(hContact, pluginName, "Excluded", 0)) - contacts.push_back(hContact); + char *proto_tmp = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + if(proto_tmp) + if(!strcmp(proto.c_str(), proto_tmp)) + if(DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && DBGetContactSettingByte(hContact, pluginName, "Excluded", 0)) + contacts.push_back(hContact); } boost::this_thread::sleep(boost::posix_time::seconds(5)); clean_mutex.lock(); -- cgit v1.2.3