diff options
-rwxr-xr-x | src/options.cpp | 8 | ||||
-rwxr-xr-x | src/stopspam.cpp | 3 | ||||
-rwxr-xr-x | src/utilities.cpp | 16 |
3 files changed, 13 insertions, 14 deletions
diff --git a/src/options.cpp b/src/options.cpp index 76e448e..4bd0886 100755 --- a/src/options.cpp +++ b/src/options.cpp @@ -173,12 +173,12 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { TranslateDialogDefault(hwnd); int n; - PROTOCOLDESCRIPTOR** pppd; - if(!CallService(MS_PROTO_ENUMPROTOCOLS, (LPARAM)&n, (WPARAM)&pppd)) + PROTOACCOUNT **pppd; + if(!ProtoEnumAccounts(&n, &pppd)) for(int i = 0; i < n; ++i) { - SendDlgItemMessageA(hwnd, (ProtoInList(pppd[i]->szName) ? ID_USEDPROTO : ID_ALLPROTO), - LB_ADDSTRING, 0, (LPARAM)pppd[i]->szName); + SendDlgItemMessageA(hwnd, (ProtoInList(pppd[i]->szModuleName) ? ID_USEDPROTO : ID_ALLPROTO), + LB_ADDSTRING, 0, (LPARAM)pppd[i]->szModuleName); } } return TRUE; diff --git a/src/stopspam.cpp b/src/stopspam.cpp index 5c13ec6..1c3f06e 100755 --- a/src/stopspam.cpp +++ b/src/stopspam.cpp @@ -50,8 +50,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) { if(!(dbei.flags & DBEF_SENT) && !(dbei.flags & DBEF_READ) && dbei.eventType == EVENTTYPE_AUTHREQUEST) { - HANDLE hcntct; - hcntct=*((PHANDLE)(dbei.pBlob+sizeof(DWORD))); + HANDLE hcntct = DbGetAuthEventContact(&dbei); // if request is from unknown or not marked Answered contact int a = DBGetContactSettingByte(hcntct, "CList", "NotOnList", 0); diff --git a/src/utilities.cpp b/src/utilities.cpp index 3685091..ae1d8ab 100755 --- a/src/utilities.cpp +++ b/src/utilities.cpp @@ -113,7 +113,7 @@ void RemoveExcludedUsers() { HANDLE hContact; hContact_entry *first, *plist, *tmp; - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + hContact = db_find_first(); first = new hContact_entry; plist = first; plist->hContact = INVALID_HANDLE_VALUE; @@ -127,7 +127,7 @@ void RemoveExcludedUsers() plist = plist->next; plist->hContact = INVALID_HANDLE_VALUE; } - }while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0)); + }while(hContact = db_find_next(hContact)); plist = first; while(plist->hContact != INVALID_HANDLE_VALUE) @@ -154,7 +154,7 @@ void RemoveTemporaryUsers() { HANDLE hContact; hContact_entry *first, *plist, *tmp; - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + hContact = db_find_first(); first = new hContact_entry; plist = first; plist->hContact = INVALID_HANDLE_VALUE; @@ -170,7 +170,7 @@ void RemoveTemporaryUsers() plist = plist->next; plist->hContact = INVALID_HANDLE_VALUE; } - }while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0)); + }while(hContact = db_find_next(hContact)); plist = first; while(plist->hContact != INVALID_HANDLE_VALUE) @@ -407,7 +407,7 @@ void CleanProtocolTmpThread(std::string proto) 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)) + for(HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { char *proto_tmp = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); if(proto_tmp) @@ -437,7 +437,7 @@ void CleanProtocolExclThread(std::string proto) 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)) + for(HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { char *proto_tmp = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); if(proto_tmp) @@ -511,7 +511,7 @@ std::string toUTF8(std::wstring str) try{ utf8::utf16to8(str.begin(), str.end(), back_inserter(ustr)); } - catch(const std::exception &e) + catch(const std::exception&) { //TODO: handle utf8cpp exceptions } @@ -532,7 +532,7 @@ std::wstring toUTF16(std::string str) //convert as much as possible utf8::replace_invalid(str.begin(), str.end(), back_inserter(tmpstr)); utf8::utf8to16(tmpstr.begin(), tmpstr.end(), back_inserter(ustr)); } - catch(const std::exception &e) + catch(const std::exception &) { //TODO: handle utf8cpp exceptions } |