summaryrefslogtreecommitdiff
path: root/src/mir_core/db.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-27 19:01:09 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-27 19:01:09 +0000
commit0800db775a4da41507478a02fa8cb9e58f35b0c9 (patch)
tree7472a040478be43bf27f27daa16c71c9794e5cb0 /src/mir_core/db.cpp
parente7f9349e332baac6ae96a93ceca2a2611409966f (diff)
db_mc_isMeta / db_mc_isSub - first functions of the new cache-based MC layer
git-svn-id: http://svn.miranda-ng.org/main/trunk@8311 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core/db.cpp')
-rw-r--r--src/mir_core/db.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mir_core/db.cpp b/src/mir_core/db.cpp
index c22b0e1415..2652278143 100644
--- a/src/mir_core/db.cpp
+++ b/src/mir_core/db.cpp
@@ -321,6 +321,27 @@ MIR_CORE_DLL(HANDLE) db_event_prev(HANDLE hDbEvent)
}
/////////////////////////////////////////////////////////////////////////////////////////
+// metacontacts
+
+MIR_CORE_DLL(int) db_mc_isMeta(MCONTACT hContact)
+{
+ if (currDb == NULL)
+ return false;
+
+ DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact);
+ return (cc == NULL) ? false : cc->nSubs != -1;
+}
+
+MIR_CORE_DLL(int) db_mc_isSub(MCONTACT hContact)
+{
+ if (currDb == NULL)
+ return false;
+
+ DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact);
+ return (cc == NULL) ? false : cc->parentID != INVALID_CONTACT_ID;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// misc functions
MIR_CORE_DLL(INT_PTR) db_free(DBVARIANT *dbv)