summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/delphi/m_metacontacts.inc6
-rw-r--r--include/m_metacontacts.h5
-rw-r--r--src/mir_core/mc.cpp7
3 files changed, 16 insertions, 2 deletions
diff --git a/include/delphi/m_metacontacts.inc b/include/delphi/m_metacontacts.inc
index 46becec44c..9f88299601 100644
--- a/include/delphi/m_metacontacts.inc
+++ b/include/delphi/m_metacontacts.inc
@@ -44,6 +44,12 @@ const
lParam=0 }
ME_MC_SUBCONTACTSCHANGED = 'MetaContacts/SubcontactsChanged';
+ { signalizes that metacontacts are enabled or disabled
+ wParam=(BOOL)bEnabled
+ lParam=0
+ }
+ ME_MC_ENABLED = 'MetaContacts/OnEnabled';
+
{ wParam=(HANDLE)hContact
lParam=0
convert a given contact into a metacontact
diff --git a/include/m_metacontacts.h b/include/m_metacontacts.h
index 22bc991815..6a06540629 100644
--- a/include/m_metacontacts.h
+++ b/include/m_metacontacts.h
@@ -46,6 +46,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// lParam=0
#define ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged"
+// wParam=(BOOL)bEnabled
+// lParam=0
+// 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
diff --git a/src/mir_core/mc.cpp b/src/mir_core/mc.cpp
index 8fdc9fda4a..ba9bbb7697 100644
--- a/src/mir_core/mc.cpp
+++ b/src/mir_core/mc.cpp
@@ -24,12 +24,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
-static HANDLE hEventDefaultChanged;
+static HANDLE hEventDefaultChanged, hEventEnabled;
static bool g_bEnabled;
void InitMetaContacts()
{
hEventDefaultChanged = CreateHookableEvent(ME_MC_DEFAULTTCHANGED);
+ hEventEnabled = CreateHookableEvent(ME_MC_ENABLED);
}
DBCachedContact* CheckMeta(MCONTACT hMeta)
@@ -70,6 +71,8 @@ MIR_CORE_DLL(BOOL) db_mc_isEnabled(void)
MIR_CORE_DLL(void) db_mc_enable(BOOL bEnabled)
{
g_bEnabled = bEnabled != 0;
+
+ NotifyEventHooks(hEventDefaultChanged, g_bEnabled, 0);
}
MIR_CORE_DLL(BOOL) db_mc_isMeta(MCONTACT hContact)
@@ -178,4 +181,4 @@ MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum, BOOL bWri
extern "C" MIR_CORE_DLL(void) db_mc_notifyDefChange(WPARAM wParam, LPARAM lParam)
{
NotifyEventHooks(hEventDefaultChanged, wParam, lParam);
-} \ No newline at end of file
+}