summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/delphi/m_metacontacts.inc77
-rw-r--r--include/m_metacontacts.h83
-rw-r--r--libs/win32/mir_app.libbin188472 -> 192260 bytes
-rw-r--r--libs/win32/mir_core.libbin323166 -> 320286 bytes
-rw-r--r--libs/win64/mir_app.libbin183778 -> 187230 bytes
-rw-r--r--libs/win64/mir_core.libbin324326 -> 321700 bytes
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp22
-rw-r--r--plugins/CloudFile/src/cloud_file.cpp2
-rw-r--r--plugins/HistoryPlusPlus/hpp_contacts.pas2
-rw-r--r--plugins/Import/src/import.cpp2
-rw-r--r--plugins/QuickSearch/sr_window.pas7
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp8
-rw-r--r--plugins/Utils.pas/mircontacts.pas2
-rw-r--r--src/mir_app/src/meta_api.cpp160
-rw-r--r--src/mir_app/src/meta_main.cpp2
-rw-r--r--src/mir_app/src/meta_services.cpp31
-rw-r--r--src/mir_app/src/meta_utils.cpp9
-rw-r--r--src/mir_app/src/metacontacts.h6
-rw-r--r--src/mir_app/src/mir_app.def17
-rw-r--r--src/mir_app/src/mir_app64.def17
-rw-r--r--src/mir_core/src/mc.cpp188
-rw-r--r--src/mir_core/src/mir_core.def13
-rw-r--r--src/mir_core/src/mir_core64.def13
-rw-r--r--src/mir_core/src/miranda.cpp2
24 files changed, 260 insertions, 403 deletions
diff --git a/include/delphi/m_metacontacts.inc b/include/delphi/m_metacontacts.inc
index 0c780125fc..b3864e32ef 100644
--- a/include/delphi/m_metacontacts.inc
+++ b/include/delphi/m_metacontacts.inc
@@ -26,12 +26,6 @@ const
META_PROTO = 'MetaContacts';
const
- { gets the handle for the 'most online' contact
- wParam=(HANDLE)hMetaContact
- lParam=0
- returns a handle to the 'most online' contact }
- MS_MC_GETMOSTONLINECONTACT:PAnsiChar = 'MetaContacts/GetMostOnline';
-
{ fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
wParam=(HANDLE)hMetaContact
lParam=(HANDLE)hDefaultContact }
@@ -50,79 +44,52 @@ const
}
ME_MC_ENABLED:PAnsiChar = 'MetaContacts/OnEnabled';
- { wParam=(HANDLE)hContact
- lParam=0
- convert a given contact into a metacontact
- }
- MS_MC_CONVERTTOMETA:PAnsiChar = 'MetaContacts/ConvertToMetacontact';
-
- { wParam=(HANDLE)hContact
- lParam=(HANDLE)hMeta
- add an existing contact to a metacontact
- }
- MS_MC_ADDTOMETA:PAnsiChar = 'MetaContacts/AddToMetacontact';
-
- { wParam=0
- lParam=(HANDLE)hContact
- remove a contact from a metacontact
- }
- MS_MC_REMOVEFROMMETA:PAnsiChar = 'MetaContacts/RemoveFromMetacontact';
-
- {
- wParam=(HANDLE)hContact
- lParam=(HANDLE)hMeta
- add an existing contact to a metacontact
- }
- MS_MC_GETSRMMSUB:PAnsiChar = 'MetaContacts/GetSrmmSub';
-
/////////////////////////////////////////////////////////////////////////////////////////
// binary interface to MC
{ returns true if metacontacts are enabled or false otherwise }
-function db_mc_isEnabled():bool; stdcall;
- external CoreDLL name 'db_mc_isEnabled';
+function db_mc_isEnabled():bool; stdcall; external AppDLL;
{ returns true if a contact is a metacontact or false otherwise }
-procedure db_mc_enable(bEnabled:bool); stdcall;
- external CoreDLL name 'db_mc_enable';
+procedure db_mc_enable(bEnabled:bool); stdcall; external AppDLL;
{ returns true if a contact is a metacontact or false otherwise }
-function db_mc_isMeta(hContact:TMCONTACT):bool; stdcall;
- external CoreDLL name 'db_mc_isMeta';
+function db_mc_isMeta(hContact:TMCONTACT):bool; stdcall; external AppDLL;
{ returns true if a contact is a subcontact or false otherwise }
-function db_mc_isSub(hContact:TMCONTACT):bool; stdcall;
- external CoreDLL name 'db_mc_isSub';
+function db_mc_isSub(hContact:TMCONTACT):bool; stdcall; external AppDLL;
{ gets the handle for the default contact or 0 on error }
-function db_mc_getDefault(hContact:TMCONTACT):TMCONTACT; stdcall;
- external CoreDLL name 'db_mc_getDefault';
+function db_mc_getDefault(hContact:TMCONTACT):TMCONTACT; stdcall; external AppDLL;
{ gets the contact number for the default contact or -1 on error }
-function db_mc_getDefaultNum(hContact:TMCONTACT):int; stdcall;
- external CoreDLL name 'db_mc_getDefaultNum';
+function db_mc_getDefaultNum(hContact:TMCONTACT):int; stdcall; external AppDLL;
{ returns a meta contact for a subcontact or 0 otherwise }
-function db_mc_getMeta(hContact:TMCONTACT):TMCONTACT; stdcall;
- external CoreDLL name 'db_mc_getMeta';
+function db_mc_getMeta(hContact:TMCONTACT):TMCONTACT; stdcall; external AppDLL;
{ returns a meta contact for a subcontact or hContact itself otherwise }
-function db_mc_tryMeta(hContact:TMCONTACT):TMCONTACT; stdcall;
- external CoreDLL name 'db_mc_tryMeta';
+function db_mc_tryMeta(hContact:TMCONTACT):TMCONTACT; stdcall; external AppDLL;
{ returns a subcontact with the given index or 0 }
-function db_mc_getSub(hContact:TMCONTACT; idx:int):TMCONTACT; stdcall;
- external CoreDLL name 'db_mc_getSub';
+function db_mc_getSub(hContact:TMCONTACT; idx:int):TMCONTACT; stdcall; external AppDLL;
+
+// gets the handle for the 'most online' contact
+function db_mc_getMostOnline(hMetaContact:TMCONTACT):TMCONTACT; stdcall; external AppDLL;
{ gets the number of subcontacts for a metacontact or -1 on error }
-function db_mc_getSubCount(hContact:TMCONTACT):int; stdcall;
- external CoreDLL name 'db_mc_getSubCount';
+function db_mc_getSubCount(hContact:TMCONTACT):int; stdcall; external AppDLL;
{ sets the default contact, using the subcontact's handle }
-function db_mc_setDefault(hContact,hSub:TMCONTACT; bWriteDb:bool):int; stdcall;
- external CoreDLL name 'db_mc_setDefault';
+function db_mc_setDefault(hContact,hSub:TMCONTACT; bWriteDb:bool):int; stdcall; external AppDLL;
{ sets the default contact, using the subcontact's number }
-function db_mc_setDefaultNum(hContact:TMCONTACT; idx:int; bWriteDb:bool):int; stdcall;
- external CoreDLL name 'db_mc_setDefaultNum';
+function db_mc_setDefaultNum(hContact:TMCONTACT; idx:int; bWriteDb:bool):int; stdcall; external AppDLL;
+
+// converts a given contact into a metacontact
+function db_mc_convertToMeta(hContact:TMCONTACT):int; stdcall; external AppDLL;
+
+// converts a given contact into a metacontact
+function db_mc_addToMeta(hContact,hMeta:TMCONTACT):int; stdcall; external AppDLL;
+
{$ENDIF}
diff --git a/include/m_metacontacts.h b/include/m_metacontacts.h
index 730a9a32af..38b00d690d 100644
--- a/include/m_metacontacts.h
+++ b/include/m_metacontacts.h
@@ -30,12 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define META_PROTO "MetaContacts"
#define META_PROTOW L"MetaContacts"
-//gets the handle for the 'most online' contact
-//wParam=(HANDLE)hMetaContact
-//lParam=0
-//returns a handle to the 'most online' contact
-#define MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline"
-
// fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
// wParam=(HANDLE)hMetaContact
// lParam=(HANDLE)hDefaultContact
@@ -52,26 +46,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// signalizes that metacontacts are enabled or disabled
#define ME_MC_ENABLED "MetaContacts/OnEnabled"
-// wParam=(HANDLE)hContact
-// lParam=0
-// convert a given contact into a metacontact
-#define MS_MC_CONVERTTOMETA "MetaContacts/ConvertToMetacontact"
-
-// wParam=(HANDLE)hContact
-// lParam=(HANDLE)hMeta
-// add an existing contact to a metacontact
-#define MS_MC_ADDTOMETA "MetaContacts/AddToMetacontact"
-
-// wParam=0
-// lParam=(HANDLE)hContact
-// remove a contact from a metacontact
-#define MS_MC_REMOVEFROMMETA "MetaContacts/RemoveFromMetacontact"
-
-// wParam=(HANDLE)hContact
-// lParam=(HANDLE)hMeta
-// add an existing contact to a metacontact
-#define MS_MC_GETSRMMSUB "MetaContacts/GetSrmmSub"
-
/////////////////////////////////////////////////////////////////////////////////////////
// binary interface to MC
@@ -80,47 +54,54 @@ extern "C"
{
#endif
-MCONTACT __forceinline db_mc_getMostOnline(MCONTACT hContact)
-{ return CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
-}
-
-MCONTACT __forceinline db_mc_getSrmmSub(MCONTACT hContact)
-{ return CallService(MS_MC_GETSRMMSUB, hContact, 0);
-}
-
// checks whether metacontacts are enabled
-MIR_CORE_DLL(BOOL) db_mc_isEnabled(void);
-MIR_CORE_DLL(void) db_mc_enable(BOOL);
+MIR_APP_DLL(BOOL) db_mc_isEnabled(void);
+MIR_APP_DLL(void) db_mc_enable(BOOL);
// checks whether a contact is a metacontact
-MIR_CORE_DLL(BOOL) db_mc_isMeta(MCONTACT hMetaContact);
+MIR_APP_DLL(BOOL) db_mc_isMeta(MCONTACT hMetaContact);
// checks whether a contact is a subcontact of existing MC
-MIR_CORE_DLL(BOOL) db_mc_isSub(MCONTACT hSubContact);
+MIR_APP_DLL(BOOL) db_mc_isSub(MCONTACT hSubContact);
-//returns a handle to the default contact, or null on failure
-MIR_CORE_DLL(MCONTACT) db_mc_getDefault(MCONTACT hMetaContact);
+// returns a handle to the default contact, or null on failure
+MIR_APP_DLL(MCONTACT) db_mc_getDefault(MCONTACT hMetaContact);
-//returns the default contact number, or -1 on failure
-MIR_CORE_DLL(int) db_mc_getDefaultNum(MCONTACT hMetaContact);
+// returns the default contact number, or -1 on failure
+MIR_APP_DLL(int) db_mc_getDefaultNum(MCONTACT hMetaContact);
-//returns the number of subcontacts, or -1 on failure
-MIR_CORE_DLL(int) db_mc_getSubCount(MCONTACT hMetaContact);
+// returns the number of subcontacts, or -1 on failure
+MIR_APP_DLL(int) db_mc_getSubCount(MCONTACT hMetaContact);
// returns parent hContact for a subcontact or NULL if it's not a sub
-MIR_CORE_DLL(MCONTACT) db_mc_getMeta(MCONTACT hSubContact);
+MIR_APP_DLL(MCONTACT) db_mc_getMeta(MCONTACT hSubContact);
// returns parent hContact for a subcontact or hContact itself if it's not a sub
-MIR_CORE_DLL(MCONTACT) db_mc_tryMeta(MCONTACT hContact);
+MIR_APP_DLL(MCONTACT) db_mc_tryMeta(MCONTACT hContact);
// returns a subcontact with the given index
-MIR_CORE_DLL(MCONTACT) db_mc_getSub(MCONTACT hMetaContact, int iNum);
+MIR_APP_DLL(MCONTACT) db_mc_getSub(MCONTACT hMetaContact, int iNum);
+
+// returns the default sub a SRMM window
+MIR_APP_DLL(MCONTACT) db_mc_getSrmmSub(MCONTACT hContact);
+
+// gets the handle for the 'most online' contact
+MIR_APP_DLL(MCONTACT) db_mc_getMostOnline(MCONTACT hContact);
+
+// sets the default contact, using the subcontact's handle
+MIR_APP_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub, BOOL bWriteDb);
+
+// sets the default contact, using the subcontact's number
+MIR_APP_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum, BOOL bWriteDb);
+
+// converts a contact into a meta
+MIR_APP_DLL(MCONTACT) db_mc_convertToMeta(MCONTACT hContact);
-//sets the default contact, using the subcontact's handle
-MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub, BOOL bWriteDb);
+// adds a contact to meta
+MIR_APP_DLL(int) db_mc_addToMeta(MCONTACT hSub, MCONTACT hMetaContact);
-//sets the default contact, using the subcontact's number
-MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum, BOOL bWriteDb);
+// removes a contact to meta
+MIR_APP_DLL(int) db_mc_removeFromMeta(MCONTACT hSub);
#if defined(__cplusplus)
}
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 902304c207..56630ca268 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib
index ae087fdef9..6d8215382b 100644
--- a/libs/win32/mir_core.lib
+++ b/libs/win32/mir_core.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index 19cf29fec6..8b0b09292d 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib
index 778ce4008b..d96c8e9bd8 100644
--- a/libs/win64/mir_core.lib
+++ b/libs/win64/mir_core.lib
Binary files differ
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
diff --git a/src/mir_app/src/meta_api.cpp b/src/mir_app/src/meta_api.cpp
index ba704ade6e..ddb6411cec 100644
--- a/src/mir_app/src/meta_api.cpp
+++ b/src/mir_app/src/meta_api.cpp
@@ -24,49 +24,157 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "metacontacts.h"
-// gets the handle for the 'most online' contact
-// wParam=(MCONTACT)hMetaContact
-// lParam=0
-// returns a handle to the 'most online' contact
+MIR_APP_DLL(BOOL) db_mc_isEnabled(void)
+{
+ return g_bMetaEnabled;
+}
+
+MIR_APP_DLL(void) db_mc_enable(BOOL bEnabled)
+{
+ g_bMetaEnabled = bEnabled != 0;
+
+ NotifyEventHooks(hEventEnabled, g_bMetaEnabled, 0);
+}
+
+MIR_APP_DLL(BOOL) db_mc_isMeta(MCONTACT hContact)
+{
+ if (currDb == nullptr || !g_bMetaEnabled) return FALSE;
+
+ DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
+ return (cc == nullptr) ? FALSE : cc->nSubs != -1;
+}
+
+MIR_APP_DLL(BOOL) db_mc_isSub(MCONTACT hContact)
+{
+ if (currDb == nullptr || !g_bMetaEnabled) return FALSE;
+
+ DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
+ return (cc == nullptr) ? FALSE : cc->parentID != 0;
+}
-static INT_PTR MetaAPI_GetMostOnline(WPARAM hMetaContact, LPARAM)
+// returns a handle to the default contact, or null on failure
+MIR_APP_DLL(MCONTACT) db_mc_getDefault(MCONTACT hMetaContact)
{
DBCachedContact *cc = CheckMeta(hMetaContact);
- return (cc == nullptr) ? 0 : Meta_GetMostOnline(cc);
+ if (cc == nullptr)
+ return 0;
+
+ return (cc->nDefault != -1) ? Meta_GetContactHandle(cc, cc->nDefault) : 0;
}
-// wParam=(HANDLE)hContact
-// lParam=0
-// convert a given contact into a metacontact
+// returns the default contact number, or -1 on failure
+MIR_APP_DLL(int) db_mc_getDefaultNum(MCONTACT hMetaContact)
+{
+ DBCachedContact *cc = CheckMeta(hMetaContact);
+ return (cc == nullptr) ? -1 : cc->nDefault;
+}
-static INT_PTR MetaAPI_ConvertToMeta(WPARAM wParam, LPARAM lParam)
+// returns the number of subcontacts, or -1 on failure
+MIR_APP_DLL(int) db_mc_getSubCount(MCONTACT hMetaContact)
{
- return Meta_Convert(wParam, lParam);
+ DBCachedContact *cc = CheckMeta(hMetaContact);
+ return (cc == nullptr) ? -1 : cc->nSubs;
}
-// wParam=(HANDLE)hContact
-// lParam=(HANDLE)hMeta
-// add an existing contact to a metacontact
+// returns parent hContact for a subcontact or NULL if it's not a sub
+MIR_APP_DLL(MCONTACT) db_mc_getMeta(MCONTACT hSubContact)
+{
+ if (currDb == nullptr) return NULL;
+
+ DBCachedContact *cc = currDb->getCache()->GetCachedContact(hSubContact);
+ return (cc == nullptr) ? NULL : cc->parentID;
+}
-static INT_PTR MetaAPI_AddToMeta(WPARAM wParam, LPARAM lParam)
+// returns parent hContact for a subcontact or hContact itself if it's not a sub
+MIR_APP_DLL(MCONTACT) db_mc_tryMeta(MCONTACT hContact)
{
- return Meta_Assign(wParam, lParam, FALSE);
+ if (currDb == nullptr) return hContact;
+
+ DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
+ if (cc == nullptr) return hContact;
+
+ return (cc->IsSub()) ? cc->parentID : hContact;
}
-// wParam=0
-// lParam=(HANDLE)hContact
-// remove a contact from a metacontact
+// returns a subcontact with the given index
+MIR_APP_DLL(MCONTACT) db_mc_getSub(MCONTACT hMetaContact, int iNum)
+{
+ DBCachedContact *cc = CheckMeta(hMetaContact);
+ return (cc == nullptr) ? 0 : Meta_GetContactHandle(cc, iNum);
+}
+
+// gets the handle for the 'most online' contact
+MIR_APP_DLL(MCONTACT) db_mc_getMostOnline(MCONTACT hMetaContact)
+{
+ DBCachedContact *cc = CheckMeta(hMetaContact);
+ return (cc == nullptr) ? 0 : Meta_GetMostOnline(cc);
+}
+
+// returns manually chosen sub in the meta window
+MIR_APP_DLL(MCONTACT) db_mc_getSrmmSub(MCONTACT hContact)
+{
+ MetaSrmmData tmp = { hContact };
+ if (MetaSrmmData *p = arMetaWindows.find(&tmp))
+ return p->m_hSub;
+
+ return db_mc_getMostOnline(hContact);
+}
+
+// converts a given contact into a metacontact
+MIR_APP_DLL(MCONTACT) db_mc_convertToMeta(MCONTACT hContact)
+{
+ return Meta_Convert(hContact, 0);
+}
-static INT_PTR MetaAPI_RemoveFromMeta(WPARAM wParam, LPARAM lParam)
+// adds an existing contact to a metacontact
+MIR_APP_DLL(int) db_mc_addToMeta(MCONTACT hSub, MCONTACT hMetaContact)
+{
+ return Meta_Assign(hSub, hMetaContact, FALSE);
+}
+
+// removes a contact from a metacontact
+MIR_APP_DLL(int) db_mc_removeFromMeta(MCONTACT hSub)
{
// notice we switch args - to keep the API function consistent with the others
- return Meta_Delete(lParam, wParam);
+ return Meta_Delete(hSub, true);
}
-void CreateApiServices()
+// sets the default contact, using the subcontact's handle
+MIR_APP_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub, BOOL bWriteDb)
{
- CreateServiceFunction(MS_MC_GETMOSTONLINECONTACT, MetaAPI_GetMostOnline);
- CreateServiceFunction(MS_MC_CONVERTTOMETA, MetaAPI_ConvertToMeta);
- CreateServiceFunction(MS_MC_ADDTOMETA, MetaAPI_AddToMeta);
- CreateServiceFunction(MS_MC_REMOVEFROMMETA, MetaAPI_RemoveFromMeta);
+ DBCachedContact *cc = CheckMeta(hMetaContact);
+ if (cc == nullptr)
+ return 1;
+
+ int contact_number = Meta_GetContactNumber(cc, hSub);
+ if (contact_number == -1)
+ return 1;
+
+ if (cc->nDefault != contact_number) {
+ cc->nDefault = contact_number;
+ if (bWriteDb)
+ currDb->MetaSetDefault(cc);
+
+ NotifyEventHooks(hEventDefaultChanged, hMetaContact, hSub);
+ }
+ return 0;
+}
+
+// sets the default contact, using the subcontact's number
+MIR_APP_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum, BOOL bWriteDb)
+{
+ DBCachedContact *cc = CheckMeta(hMetaContact);
+ if (cc == nullptr)
+ return 1;
+ if (iNum >= cc->nSubs || iNum < 0)
+ return 1;
+
+ if (cc->nDefault != iNum) {
+ cc->nDefault = iNum;
+ if (bWriteDb)
+ currDb->MetaSetDefault(cc);
+
+ NotifyEventHooks(hEventDefaultChanged, hMetaContact, Meta_GetContactHandle(cc, iNum));
+ }
+ return 0;
}
diff --git a/src/mir_app/src/meta_main.cpp b/src/mir_app/src/meta_main.cpp
index 8e1be3ecd1..f15865ab3e 100644
--- a/src/mir_app/src/meta_main.cpp
+++ b/src/mir_app/src/meta_main.cpp
@@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "metacontacts.h"
+bool g_bMetaEnabled;
+
/////////////////////////////////////////////////////////////////////////////////////////
// icolib support
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp
index f8062a5bd8..39874a71c9 100644
--- a/src/mir_app/src/meta_services.cpp
+++ b/src/mir_app/src/meta_services.cpp
@@ -27,16 +27,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "clc.h"
#include "metacontacts.h"
-extern "C" MIR_CORE_DLL(void) db_mc_notifyDefChange(WPARAM wParam, LPARAM lParam);
-
char *pendingACK = nullptr; // Name of the protocol in which an ACK is about to come.
int previousMode, // Previous status of the MetaContacts Protocol
mcStatus; // Current status of the MetaContacts Protocol
-HANDLE
-hSubcontactsChanged, // HANDLE to the 'contacts changed' event
-hEventNudge;
+HANDLE hSubcontactsChanged; // ME_MC_SUBCONTACTSCHANGED
+HANDLE hEventDefaultChanged; // ME_MC_DEFAULTTCHANGED
+HANDLE hEventEnabled; // ME_MC_ENABLED
UINT_PTR setStatusTimerId = 0;
BOOL firstSetOnline = TRUE; // see Meta_SetStatus function
@@ -424,7 +422,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
// set status to that of most online contact
MCONTACT hMostOnline = Meta_GetMostOnline(ccMeta);
if (hMostOnline != db_mc_getDefault(ccMeta->contactID))
- db_mc_notifyDefChange(ccMeta->contactID, hMostOnline);
+ NotifyEventHooks(hEventDefaultChanged, ccMeta->contactID, hMostOnline);
Meta_CopyContactNick(ccMeta, hMostOnline);
Meta_FixStatus(ccMeta);
@@ -560,18 +558,6 @@ static int Meta_MessageWindowEvent(WPARAM, LPARAM lParam)
}
/////////////////////////////////////////////////////////////////////////////////////////
-// returns manually chosen sub in the meta window
-
-static INT_PTR Meta_SrmmCurrentSub(WPARAM hMeta, LPARAM)
-{
- MetaSrmmData tmp = { (MCONTACT)hMeta };
- if (MetaSrmmData *p = arMetaWindows.find(&tmp))
- return p->m_hSub;
-
- return db_mc_getMostOnline(hMeta);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// we assume that it could be called only for the metacontacts
static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam)
@@ -872,15 +858,14 @@ void Meta_InitServices()
CreateProtoServiceFunction(META_FILTER, PSR_MESSAGE, MetaFilter_RecvMessage);
// API services and events
- CreateApiServices();
-
CreateServiceFunction("MetaContacts/OnOff", Meta_OnOff);
- CreateServiceFunction(MS_MC_GETSRMMSUB, Meta_SrmmCurrentSub);
CreateProtoServiceFunction(META_PROTO, PS_SEND_NUDGE, Meta_SendNudge);
// create our hookable events
+ hEventEnabled = CreateHookableEvent(ME_MC_ENABLED);
hSubcontactsChanged = CreateHookableEvent(ME_MC_SUBCONTACTSCHANGED);
+ hEventDefaultChanged = CreateHookableEvent(ME_MC_DEFAULTTCHANGED);
// hook other module events we need
HookEvent(ME_PROTO_ACK, Meta_HandleACK);
@@ -892,9 +877,6 @@ void Meta_InitServices()
// hook our own events, used to call Meta_GetMostOnline which sets nick for metacontact
HookEvent(ME_MC_DEFAULTTCHANGED, Meta_CallMostOnline);
-
- // redirect nudge events
- hEventNudge = CreateHookableEvent(META_PROTO PE_NUDGE);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -903,5 +885,4 @@ void Meta_InitServices()
void Meta_CloseHandles()
{
DestroyHookableEvent(hSubcontactsChanged);
- DestroyHookableEvent(hEventNudge);
}
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp
index 753e514101..5b8d752c04 100644
--- a/src/mir_app/src/meta_utils.cpp
+++ b/src/mir_app/src/meta_utils.cpp
@@ -296,16 +296,17 @@ DBCachedContact* CheckMeta(MCONTACT hMeta)
int Meta_GetContactNumber(DBCachedContact *cc, MCONTACT hContact)
{
- for (int i = 0; i < cc->nSubs; i++)
- if (cc->pSubs[i] == hContact)
- return i;
+ if (g_bMetaEnabled)
+ for (int i = 0; i < cc->nSubs; i++)
+ if (cc->pSubs[i] == hContact)
+ return i;
return -1;
}
MCONTACT Meta_GetContactHandle(DBCachedContact *cc, int contact_number)
{
- if (contact_number >= cc->nSubs || contact_number < 0)
+ if (contact_number >= cc->nSubs || contact_number < 0 || !g_bMetaEnabled)
return 0;
return cc->pSubs[contact_number];
diff --git a/src/mir_app/src/metacontacts.h b/src/mir_app/src/metacontacts.h
index 3c7cbdd90d..590c886a84 100644
--- a/src/mir_app/src/metacontacts.h
+++ b/src/mir_app/src/metacontacts.h
@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// contact menu items
void InitMenus();
extern int mcStatus;
+extern bool g_bMetaEnabled;
struct MetaSrmmData
{
@@ -98,14 +99,13 @@ extern MetaOptions g_metaOptions;
int Meta_OptInit(WPARAM wParam, LPARAM lParam);
int Meta_ReadOptions();
-// API function headers
-void CreateApiServices();
+/////////////////////////////////////////////////////////////////////////////////////////
typedef enum {I_MENUOFF, I_MENU, I_CONVERT, I_ADD, I_EDIT, I_SETDEFAULT, I_REMOVE} IconIndex;
HICON Meta_LoadIconEx(IconIndex i, bool big = false);
HANDLE Meta_GetIconHandle(IconIndex i);
-extern HANDLE hEventForceSend, hEventUnforceSend, hSubcontactsChanged;
+extern HANDLE hSubcontactsChanged, hEventDefaultChanged, hEventEnabled;
extern POINT menuMousePoint;
#define MAX_PROTOCOLS 20
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index b7feb9939b..82d6345ebf 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -678,3 +678,20 @@ Chat_SetGroup @706
??6@YGPAUMHttpRequest@@PAU0@ABUWCHAR_PARAM@@@Z @713 NONAME
??6@YGPAUMHttpRequest@@PAU0@ABUINT64_PARAM@@@Z @714 NONAME
?AddHeader@MHttpRequest@@QAEXPBD0@Z @715 NONAME
+db_mc_addToMeta @716
+db_mc_convertToMeta @717
+db_mc_enable @718
+db_mc_getDefault @719
+db_mc_getDefaultNum @720
+db_mc_getMeta @721
+db_mc_getMostOnline @722
+db_mc_getSrmmSub @723
+db_mc_getSub @724
+db_mc_getSubCount @725
+db_mc_isEnabled @726
+db_mc_isMeta @727
+db_mc_isSub @728
+db_mc_removeFromMeta @729
+db_mc_setDefault @730
+db_mc_setDefaultNum @731
+db_mc_tryMeta @732
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index f4fc8d7df4..f17e4dc692 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -678,3 +678,20 @@ Chat_SetGroup @706
??6@YAPEAUMHttpRequest@@PEAU0@AEBUWCHAR_PARAM@@@Z @713 NONAME
??6@YAPEAUMHttpRequest@@PEAU0@AEBUINT64_PARAM@@@Z @714 NONAME
?AddHeader@MHttpRequest@@QEAAXPEBD0@Z @715 NONAME
+db_mc_addToMeta @716
+db_mc_convertToMeta @717
+db_mc_enable @718
+db_mc_getDefault @719
+db_mc_getDefaultNum @720
+db_mc_getMeta @721
+db_mc_getMostOnline @722
+db_mc_getSrmmSub @723
+db_mc_getSub @724
+db_mc_getSubCount @725
+db_mc_isEnabled @726
+db_mc_isMeta @727
+db_mc_isSub @728
+db_mc_removeFromMeta @729
+db_mc_setDefault @730
+db_mc_setDefaultNum @731
+db_mc_tryMeta @732
diff --git a/src/mir_core/src/mc.cpp b/src/mir_core/src/mc.cpp
deleted file mode 100644
index ce38931fcb..0000000000
--- a/src/mir_core/src/mc.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (C) 2012-19 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-12 Miranda IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-static HANDLE hEventDefaultChanged, hEventEnabled;
-static bool g_bEnabled;
-
-void InitMetaContacts()
-{
- hEventDefaultChanged = CreateHookableEvent(ME_MC_DEFAULTTCHANGED);
- hEventEnabled = CreateHookableEvent(ME_MC_ENABLED);
-}
-
-DBCachedContact* CheckMeta(MCONTACT hMeta)
-{
- if (!g_bEnabled)
- return nullptr;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hMeta);
- return (cc == nullptr || cc->nSubs == -1) ? nullptr : cc;
-}
-
-int Meta_GetContactNumber(DBCachedContact *cc, MCONTACT hContact)
-{
- if (g_bEnabled)
- for (int i = 0; i < cc->nSubs; i++)
- if (cc->pSubs[i] == hContact)
- return i;
-
- return -1;
-}
-
-MCONTACT Meta_GetContactHandle(DBCachedContact *cc, int contact_number)
-{
- if (contact_number >= cc->nSubs || contact_number < 0 || !g_bEnabled)
- return 0;
-
- return cc->pSubs[contact_number];
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// metacontacts
-
-MIR_CORE_DLL(BOOL) db_mc_isEnabled(void)
-{
- return g_bEnabled;
-}
-
-MIR_CORE_DLL(void) db_mc_enable(BOOL bEnabled)
-{
- g_bEnabled = bEnabled != 0;
-
- NotifyEventHooks(hEventEnabled, g_bEnabled, 0);
-}
-
-MIR_CORE_DLL(BOOL) db_mc_isMeta(MCONTACT hContact)
-{
- if (currDb == nullptr || !g_bEnabled) return FALSE;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
- return (cc == nullptr) ? FALSE : cc->nSubs != -1;
-}
-
-MIR_CORE_DLL(BOOL) db_mc_isSub(MCONTACT hContact)
-{
- if (currDb == nullptr || !g_bEnabled) return FALSE;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
- return (cc == nullptr) ? FALSE : cc->parentID != 0;
-}
-
-//returns a handle to the default contact, or null on failure
-MIR_CORE_DLL(MCONTACT) db_mc_getDefault(MCONTACT hMetaContact)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- if (cc == nullptr)
- return 0;
-
- return (cc->nDefault != -1) ? Meta_GetContactHandle(cc, cc->nDefault) : 0;
-}
-
-//returns the default contact number, or -1 on failure
-MIR_CORE_DLL(int) db_mc_getDefaultNum(MCONTACT hMetaContact)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- return (cc == nullptr) ? -1 : cc->nDefault;
-}
-
-//returns the number of subcontacts, or -1 on failure
-MIR_CORE_DLL(int) db_mc_getSubCount(MCONTACT hMetaContact)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- return (cc == nullptr) ? -1 : cc->nSubs;
-}
-
-// returns parent hContact for a subcontact or NULL if it's not a sub
-MIR_CORE_DLL(MCONTACT) db_mc_getMeta(MCONTACT hSubContact)
-{
- if (currDb == nullptr) return NULL;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hSubContact);
- return (cc == nullptr) ? NULL : cc->parentID;
-}
-
-// returns parent hContact for a subcontact or hContact itself if it's not a sub
-MIR_CORE_DLL(MCONTACT) db_mc_tryMeta(MCONTACT hContact)
-{
- if (currDb == nullptr) return hContact;
-
- DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
- if (cc == nullptr) return hContact;
-
- return (cc->IsSub()) ? cc->parentID : hContact;
-}
-
-// returns a subcontact with the given index
-MIR_CORE_DLL(MCONTACT) db_mc_getSub(MCONTACT hMetaContact, int iNum)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- return (cc == nullptr) ? 0 : Meta_GetContactHandle(cc, iNum);
-}
-
-//sets the default contact, using the subcontact's handle
-MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub, BOOL bWriteDb)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- if (cc == nullptr)
- return 1;
-
- int contact_number = Meta_GetContactNumber(cc, hSub);
- if (contact_number == -1)
- return 1;
-
- if (cc->nDefault != contact_number) {
- cc->nDefault = contact_number;
- if (bWriteDb)
- currDb->MetaSetDefault(cc);
-
- NotifyEventHooks(hEventDefaultChanged, hMetaContact, hSub);
- }
- return 0;
-}
-
-//sets the default contact, using the subcontact's number
-MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum, BOOL bWriteDb)
-{
- DBCachedContact *cc = CheckMeta(hMetaContact);
- if (cc == nullptr)
- return 1;
- if (iNum >= cc->nSubs || iNum < 0)
- return 1;
-
- if (cc->nDefault != iNum) {
- cc->nDefault = iNum;
- if (bWriteDb)
- currDb->MetaSetDefault(cc);
-
- NotifyEventHooks(hEventDefaultChanged, hMetaContact, Meta_GetContactHandle(cc, iNum));
- }
- return 0;
-}
-
-extern "C" MIR_CORE_DLL(void) db_mc_notifyDefChange(WPARAM wParam, LPARAM lParam)
-{
- NotifyEventHooks(hEventDefaultChanged, wParam, lParam);
-}
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 2626bbf556..f5c92d7159 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -181,24 +181,11 @@ IsScreenSaverRunning @243
db_get_static @246
db_get_wstatic @247
db_get_static_utf @248
-db_mc_isMeta @249
-db_mc_isSub @250
-db_mc_getMeta @251
db_get_contact @252
-db_mc_getDefault @253
-db_mc_getDefaultNum @254
-db_mc_getSubCount @255
-db_mc_getSub @256
-db_mc_setDefault @257
-db_mc_setDefaultNum @258
mir_closeLog @259
-db_mc_enable @260
-db_mc_isEnabled @261
LoadLangPackDescr @262
PathIsAbsolute @263
PathIsAbsoluteW @264
-db_mc_notifyDefChange @265
-db_mc_tryMeta @266
mir_strlen @267
mir_wstrlen @268
mir_strcpy @269
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 6a5981c157..87050de4e9 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -181,24 +181,11 @@ IsScreenSaverRunning @243
db_get_static @246
db_get_wstatic @247
db_get_static_utf @248
-db_mc_isMeta @249
-db_mc_isSub @250
-db_mc_getMeta @251
db_get_contact @252
-db_mc_getDefault @253
-db_mc_getDefaultNum @254
-db_mc_getSubCount @255
-db_mc_getSub @256
-db_mc_setDefault @257
-db_mc_setDefaultNum @258
mir_closeLog @259
-db_mc_enable @260
-db_mc_isEnabled @261
LoadLangPackDescr @262
PathIsAbsolute @263
PathIsAbsoluteW @264
-db_mc_notifyDefChange @265
-db_mc_tryMeta @266
mir_strlen @267
mir_wstrlen @268
mir_strcpy @269
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp
index 73346d1eae..91ed71b53b 100644
--- a/src/mir_core/src/miranda.cpp
+++ b/src/mir_core/src/miranda.cpp
@@ -36,7 +36,6 @@ void UninitLogs();
void InitColourPicker();
void InitHyperlink();
-void InitMetaContacts();
void InitTimeZones();
void InitWinver();
@@ -114,7 +113,6 @@ static void LoadCoreModule(void)
InitHyperlink();
InitTimeZones();
InitialiseModularEngine();
- InitMetaContacts();
CreateServiceFunction(MS_SYSTEM_RESTART, RestartMiranda);