summaryrefslogtreecommitdiff
path: root/include/m_protoint.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/m_protoint.h')
-rw-r--r--include/m_protoint.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 28343fe201..1e4fa8da62 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -2,7 +2,7 @@
Miranda NG: the free IM client for Microsoft* Windows*
-Copyright (C) 2012-24 Miranda NG team (https://miranda-ng.org)
+Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org)
Copyright (c) 2000-08 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -89,7 +89,7 @@ public:
HGENMENU m_hmiMainMenu = 0; // if protocol menus are displayed in the main menu, this is the root
PROTO_INTERFACE(const char *pszModuleName, const wchar_t *ptszUserName);
- ~PROTO_INTERFACE();
+ virtual ~PROTO_INTERFACE();
//////////////////////////////////////////////////////////////////////////////////////
// Helpers
@@ -330,6 +330,13 @@ template<class T> struct PROTO : public PROTO_INTERFACE
typedef INT_PTR(MIR_CDECL T::*MyServiceFuncParam)(WPARAM, LPARAM, LPARAM);
__forceinline void CreateProtoServiceParam(const char *name, MyServiceFuncParam pFunc, LPARAM param) {
::ProtoCreateServiceParam(this, name, (ProtoServiceFuncParam)pFunc, param); }
+
+ template<INT_PTR(__cdecl T::*MyGlobalService)(WPARAM, LPARAM)>
+ static INT_PTR MIR_CDECL GlobalService(WPARAM hContact, LPARAM lParam)
+ {
+ T *proto = CMPlugin::getInstance((MCONTACT)hContact);
+ return proto ? (proto->*MyGlobalService)(hContact, lParam) : 0;
+ }
};
/////////////////////////////////////////////////////////////////////////////////////////