diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-31 16:12:36 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-31 16:12:36 +0200 |
commit | d2ff7033051be0f7a5321ea0a09893372e52ae9e (patch) | |
tree | 3e4191ef826272b3325311f5ffc2539f435648e5 /utilities.cpp | |
parent | 42dcdb26ad220c6d95c0b13d9b4c323511454bcf (diff) |
this would be better
Diffstat (limited to 'utilities.cpp')
-rw-r--r-- | utilities.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/utilities.cpp b/utilities.cpp index 02ef0ba..e73d920 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -381,14 +381,6 @@ boost::mutex clean_mutex; void CleanProtocolTmpThread(std::string proto) { - boost::this_thread::sleep(boost::posix_time::seconds(5)); - 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); - } while(true)
{
UINT status = CallProtoService(proto.c_str(), PS_GETSTATUS, 0, 0);
@@ -396,6 +388,13 @@ void CleanProtocolTmpThread(std::string proto) break;
boost::this_thread::sleep(boost::posix_time::seconds(2));
}
+ 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); + } boost::this_thread::sleep(boost::posix_time::seconds(5));
clean_mutex.lock(); std::list<HANDLE>::iterator end = contacts.end(); @@ -410,14 +409,6 @@ void CleanProtocolTmpThread(std::string proto) void CleanProtocolExclThread(std::string proto)
{
- boost::this_thread::sleep(boost::posix_time::seconds(5));
- 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);
- }
while(true)
{
UINT status = CallProtoService(proto.c_str(), PS_GETSTATUS, 0, 0);
@@ -425,6 +416,13 @@ void CleanProtocolExclThread(std::string proto) break;
boost::this_thread::sleep(boost::posix_time::seconds(2));
}
+ 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);
+ }
boost::this_thread::sleep(boost::posix_time::seconds(5));
clean_mutex.lock();
std::list<HANDLE>::iterator end = contacts.end();
|