From 13c033c257f6c083b0c46b4fa28601db5a0b6335 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 27 Feb 2014 20:50:07 +0000 Subject: MS_MC_GETMETACONTACT => db_mc_getMeta git-svn-id: http://svn.miranda-ng.org/main/trunk@8317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/db.cpp | 15 +++++++++++---- src/mir_core/mir_core.def | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/db.cpp b/src/mir_core/db.cpp index 2652278143..dafa2b2d93 100644 --- a/src/mir_core/db.cpp +++ b/src/mir_core/db.cpp @@ -325,8 +325,7 @@ MIR_CORE_DLL(HANDLE) db_event_prev(HANDLE hDbEvent) MIR_CORE_DLL(int) db_mc_isMeta(MCONTACT hContact) { - if (currDb == NULL) - return false; + if (currDb == NULL) return false; DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact); return (cc == NULL) ? false : cc->nSubs != -1; @@ -334,13 +333,21 @@ MIR_CORE_DLL(int) db_mc_isMeta(MCONTACT hContact) MIR_CORE_DLL(int) db_mc_isSub(MCONTACT hContact) { - if (currDb == NULL) - return false; + if (currDb == NULL) return false; DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact); return (cc == NULL) ? false : cc->parentID != INVALID_CONTACT_ID; } +MIR_CORE_DLL(MCONTACT) db_mc_getMeta(MCONTACT hSubContact) +{ + if (currDb == NULL) return NULL; + + DBCachedContact *cc = currDb->m_cache->GetCachedContact(hSubContact); + return (cc == NULL) ? NULL : cc->parentID; +} + + ///////////////////////////////////////////////////////////////////////////////////////// // misc functions diff --git a/src/mir_core/mir_core.def b/src/mir_core/mir_core.def index 5ff1a5efb5..6f8d466469 100644 --- a/src/mir_core/mir_core.def +++ b/src/mir_core/mir_core.def @@ -250,3 +250,4 @@ db_get_wstatic @247 db_get_static_utf @248 db_mc_isMeta @249 db_mc_isSub @250 +db_mc_getMeta @251 -- cgit v1.2.3