From 38853f0f252956930d6bd5bcd864fb76670d548b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 1 Feb 2019 19:38:46 +0300 Subject: four forgotten meta services removed --- plugins/Clist_modern/src/modern_clc.cpp | 22 +++++++++++----------- plugins/CloudFile/src/cloud_file.cpp | 2 +- plugins/HistoryPlusPlus/hpp_contacts.pas | 2 +- plugins/Import/src/import.cpp | 2 +- plugins/QuickSearch/sr_window.pas | 7 +++---- .../src/ex_import/classExImContactXML.cpp | 8 ++++---- plugins/Utils.pas/mircontacts.pas | 2 +- 7 files changed, 22 insertions(+), 23 deletions(-) (limited to 'plugins') diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 829a1abdae..be37c637b9 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1095,11 +1095,11 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it?"), contDest->szText, contSour->szText); int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { - MCONTACT handle = CallService(MS_MC_CONVERTTOMETA, hDest, 0); + MCONTACT handle = db_mc_convertToMeta(hDest); if (!handle) return 0; - CallService(MS_MC_ADDTOMETA, hcontact, handle); + db_mc_addToMeta(hcontact, handle); } } else { @@ -1108,12 +1108,12 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, mir_snwprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it (remove it from '%s')?"), contDest->szText, contSour->szText, contSour->subcontacts->szText); int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact (moving)"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { - MCONTACT handle = (MCONTACT)CallService(MS_MC_CONVERTTOMETA, (WPARAM)hdest, 0); + MCONTACT handle = db_mc_convertToMeta(hdest); if (!handle) return 0; - CallService(MS_MC_REMOVEFROMMETA, 0, hcontact); - CallService(MS_MC_ADDTOMETA, hcontact, handle); + db_mc_removeFromMeta(hcontact); + db_mc_addToMeta(hcontact, handle); } } } @@ -1136,7 +1136,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (res == 1) { if (!handle) return 0; - CallService(MS_MC_ADDTOMETA, hcontact, handle); + db_mc_addToMeta(hcontact, handle); } } else if (contSour->subcontacts == contDest) { @@ -1155,8 +1155,8 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (!handle) return 0; - CallService(MS_MC_REMOVEFROMMETA, 0, hcontact); - CallService(MS_MC_ADDTOMETA, hcontact, handle); + db_mc_removeFromMeta(hcontact); + db_mc_addToMeta(hcontact, handle); } } } @@ -1179,7 +1179,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (!handle) return 0; - CallService(MS_MC_ADDTOMETA, hcontact, handle); + db_mc_addToMeta(hcontact, handle); } } else if (contSour->subcontacts != contDest->subcontacts) { @@ -1191,8 +1191,8 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (!handle) return 0; - CallService(MS_MC_REMOVEFROMMETA, 0, hcontact); - CallService(MS_MC_ADDTOMETA, hcontact, handle); + db_mc_removeFromMeta(hcontact); + db_mc_addToMeta(hcontact, handle); } } } diff --git a/plugins/CloudFile/src/cloud_file.cpp b/plugins/CloudFile/src/cloud_file.cpp index d1993b6d27..f6019f8196 100644 --- a/plugins/CloudFile/src/cloud_file.cpp +++ b/plugins/CloudFile/src/cloud_file.cpp @@ -80,7 +80,7 @@ void CCloudService::OpenUploadDialog(MCONTACT hContact) { char *proto = GetContactProto(hContact); if (!mir_strcmpi(proto, META_PROTO)) - hContact = CallService(MS_MC_GETMOSTONLINECONTACT, hContact); + hContact = db_mc_getMostOnline(hContact); auto it = InterceptedContacts.find(hContact); if (it == InterceptedContacts.end()) { diff --git a/plugins/HistoryPlusPlus/hpp_contacts.pas b/plugins/HistoryPlusPlus/hpp_contacts.pas index 58386f658a..d82eff0d83 100644 --- a/plugins/HistoryPlusPlus/hpp_contacts.pas +++ b/plugins/HistoryPlusPlus/hpp_contacts.pas @@ -76,7 +76,7 @@ begin Result := Proto_GetProtoName(hContact); if (Result = META_PROTO) then begin - SubContact := CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0); + SubContact := db_mc_getMostOnline(hContact); SubProtocol := Proto_GetProtoName(SubContact); end else diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index b0a3a5345a..7bd3746c4f 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -697,7 +697,7 @@ void ImportMeta(DBCachedContact *ccSrc) for (int i = 0; i < ccSrc->nSubs; i++) { MCONTACT hDstSub = MapContact(ccSrc->pSubs[i]); if (db_mc_getMeta(hDstSub) == NULL) // add a sub if needed - CallService(MS_MC_ADDTOMETA, hDstSub, hDest); + db_mc_addToMeta(hDstSub, hDest); } } diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas index 2aa6e6238c..a664f092f3 100644 --- a/plugins/QuickSearch/sr_window.pas +++ b/plugins/QuickSearch/sr_window.pas @@ -428,9 +428,9 @@ begin if ListView_GetItemState(grid,i,LVIS_SELECTED)<>0 then begin if hMeta=0 then - hMeta:=CallService(MS_MC_CONVERTTOMETA,FlagBuf[LV_GetLParam(grid,i)].contact,0) + db_mc_convertToMeta(FlagBuf[LV_GetLParam(grid,i)].contact) else - CallService(MS_MC_ADDTOMETA,FlagBuf[LV_GetLParam(grid,i)].contact,hMeta); + db_mc_addToMeta(FlagBuf[LV_GetLParam(grid,i)].contact,hMeta); end; end; end; @@ -899,8 +899,7 @@ begin AppendMenuW(mmenu,MF_SEPARATOR,0,nil); AppendMenuW(mmenu,MF_STRING,101,TranslateW('&Delete')); AppendMenuW(mmenu,MF_STRING,102,TranslateW('&Copy')); - if ServiceExists(MS_MC_CONVERTTOMETA) then - AppendMenuW(mmenu,MF_STRING,103,TranslateW('C&onvert to Meta')); + AppendMenuW(mmenu,MF_STRING,103,TranslateW('C&onvert to Meta')); cntmenu:=MakeContainerMenu(300); AppendMenuW(mmenu,MF_POPUP,cntmenu,TranslateW('Attach to &Tab container')); diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index 5c90624aaa..b349ab7b71 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -630,7 +630,7 @@ int CExImContactXML::ImportNormalContact() // remove contact from a metacontact if (err == ERROR_OK && db_mc_getMeta(_hContact)) - CallService(MS_MC_REMOVEFROMMETA, NULL, (LPARAM)_hContact); + db_mc_removeFromMeta(_hContact); return err; } @@ -667,7 +667,7 @@ int CExImContactXML::Import(BYTE keepMetaSubContact) return result; // convert default subcontact to metacontact - _hContact = (MCONTACT)CallService(MS_MC_CONVERTTOMETA, (WPARAM)vContact.handle(), NULL); + _hContact = db_mc_convertToMeta(vContact.handle()); if (_hContact == NULL) { _hContact = INVALID_CONTACT_ID; return ERROR_CONVERT_METACONTACT; @@ -705,7 +705,7 @@ int CExImContactXML::Import(BYTE keepMetaSubContact) // load contact information int result = ImportContact(); if (result == ERROR_OK && !keepMetaSubContact) - CallService(MS_MC_REMOVEFROMMETA, NULL, (LPARAM)_hContact); + db_mc_removeFromMeta(_hContact); return result; } @@ -730,7 +730,7 @@ int CExImContactXML::ImportMetaSubContact(CExImContactXML * pMetaContact) // check if contact is subcontact of the desired meta contact if (db_mc_getMeta(_hContact) != pMetaContact->handle()) { // add contact to the metacontact (this service returns TRUE if successful) - err = CallService(MS_MC_ADDTOMETA, _hContact, (LPARAM)pMetaContact->handle()); + err = db_mc_addToMeta(_hContact, pMetaContact->handle()); if (err == FALSE) { // ask to delete new contact if (_isNewContact && _hContact != NULL) { diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas index 1c3b614324..3bcd96be33 100644 --- a/plugins/Utils.pas/mircontacts.pas +++ b/plugins/Utils.pas/mircontacts.pas @@ -72,7 +72,7 @@ begin Result := Proto_GetProtoName(hContact); if StrCmp(Result, META_PROTO)=0 then begin - SubContact := CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0); + SubContact := db_mc_getMostOnline(hContact); SubProtocol := Proto_GetProtoName(SubContact); end else -- cgit v1.2.3