From 0173277372e2962b8f5703a0ebad7892dda15e6c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 9 Mar 2014 21:50:49 +0000 Subject: end of the old MC API git-svn-id: http://svn.miranda-ng.org/main/trunk@8534 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/UserInfoEx/src/mir_db.cpp | 46 +++++++-------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) (limited to 'plugins/UserInfoEx/src/mir_db.cpp') diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index 17f77c8161..4a06374b8d 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -23,36 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace DB { -namespace MetaContact { - -INT_PTR SubCount(MCONTACT hMetaContact) -{ - INT_PTR result = CallService(MS_MC_GETNUMCONTACTS, (WPARAM) hMetaContact, 0); - return (result == CALLSERVICE_NOTFOUND) ? -1 : result; -} - -INT_PTR SubDefNum(MCONTACT hMetaContact) -{ - INT_PTR result = CallService(MS_MC_GETDEFAULTCONTACTNUM, (WPARAM) hMetaContact, 0); - return (result == CALLSERVICE_NOTFOUND) ? -1 : result; -} - -MCONTACT Sub(MCONTACT hMetaContact, int idx) -{ - if (idx != -1) { - INT_PTR result = CallService(MS_MC_GETSUBCONTACT, (WPARAM) hMetaContact, (LPARAM) idx); - return (result == CALLSERVICE_NOTFOUND) ? NULL : (MCONTACT)result; - } - return NULL; -} - -MCONTACT GetMeta(MCONTACT hContact) -{ - return db_mc_getMeta(hContact); -} - -} /* namespace MetaContact */ - /** * This namespace contains all functions used to access or modify contacts in the database. **/ @@ -297,22 +267,22 @@ BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetti result = Get(hContact, pszProto, pszSetting, dbv, destType) != 0; // try to get setting from a metasubcontact if (result && DB::Module::IsMetaAndScan(pszProto)) { - const INT_PTR def = DB::MetaContact::SubDefNum(hContact); + const INT_PTR def = db_mc_getDefaultNum(hContact); MCONTACT hSubContact; // try to get setting from the default subcontact first if (def > -1 && def < INT_MAX) { - hSubContact = DB::MetaContact::Sub(hContact, def); + hSubContact = db_mc_getSub(hContact, def); if (hSubContact != NULL) result = DB::Setting::GetEx(hSubContact, pszModule, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType) != 0; } // scan all subcontacts for the setting if (result) { - const INT_PTR cnt = DB::MetaContact::SubCount(hContact); + const INT_PTR cnt = db_mc_getSubCount(hContact); if (cnt < INT_MAX) { INT_PTR i; for (i = 0; result && i < cnt; i++) { if (i != def) { - hSubContact = DB::MetaContact::Sub(hContact, i); + hSubContact = db_mc_getSub(hContact, i); if (hSubContact != NULL) result = DB::Setting::GetEx(hSubContact, pszModule, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType) != 0; } } } } } } @@ -352,11 +322,11 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps // try to read the setting from the sub contacts' modules else if (DB::Module::IsMetaAndScan(pszProto)) { - const INT_PTR def = DB::MetaContact::SubDefNum(hContact); + const INT_PTR def = db_mc_getDefaultNum(hContact); MCONTACT hSubContact; // try to get setting from the default subcontact first if (def > -1 && def < INT_MAX) { - hSubContact = DB::MetaContact::Sub(hContact, def); + hSubContact = db_mc_getSub(hContact, def); if (hSubContact != NULL) { wFlags = GetCtrl(hSubContact, pszSubModule, NULL, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType); if (wFlags != 0) { @@ -368,10 +338,10 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps // copy the missing settings from the other subcontacts if (wFlags == 0) { INT_PTR i; - const INT_PTR cnt = DB::MetaContact::SubCount(hContact); + const INT_PTR cnt = db_mc_getSubCount(hContact); for (i = 0; i < cnt; i++) { if (i != def) { - hSubContact = DB::MetaContact::Sub(hContact, i); + hSubContact = db_mc_getSub(hContact, i); if (hSubContact != NULL) { wFlags = GetCtrl(hSubContact, pszSubModule, NULL, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType); if (wFlags != 0) { -- cgit v1.2.3