diff options
-rw-r--r-- | utilities.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
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<HANDLE> 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<HANDLE> 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();
|