summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/db.cpp15
-rw-r--r--src/mir_core/mir_core.def1
-rw-r--r--src/modules/metacontacts/meta_api.cpp8
-rw-r--r--src/modules/metacontacts/meta_services.cpp1
4 files changed, 12 insertions, 13 deletions
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
diff --git a/src/modules/metacontacts/meta_api.cpp b/src/modules/metacontacts/meta_api.cpp
index 7cf4261617..66760b2442 100644
--- a/src/modules/metacontacts/meta_api.cpp
+++ b/src/modules/metacontacts/meta_api.cpp
@@ -24,14 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "metacontacts.h"
-//get the handle for a contact's parent metacontact
-//wParam=(HANDLE)hSubContact
-//lParam=0
-//returns a handle to the parent metacontact, or null if this contact is not a subcontact
-INT_PTR MetaAPI_GetMeta(WPARAM wParam, LPARAM lParam) {
- return (INT_PTR)(HANDLE)db_get_dw(wParam, META_PROTO, "Handle", 0);
-}
-
//gets the handle for the default contact
//wParam=(HANDLE)hMetaContact
//lParam=0
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp
index 7d6bd1228e..73b65cea79 100644
--- a/src/modules/metacontacts/meta_services.cpp
+++ b/src/modules/metacontacts/meta_services.cpp
@@ -1213,7 +1213,6 @@ void Meta_InitServices()
CreateProtoServiceFunction(META_FILTER, PSS_MESSAGE, MetaFilter_SendMessage);
// API services and events
- CreateServiceFunction(MS_MC_GETMETACONTACT, MetaAPI_GetMeta);
CreateServiceFunction(MS_MC_GETDEFAULTCONTACT, MetaAPI_GetDefault);
CreateServiceFunction(MS_MC_GETDEFAULTCONTACTNUM, MetaAPI_GetDefaultNum);
CreateServiceFunction(MS_MC_GETMOSTONLINECONTACT, MetaAPI_GetMostOnline);