summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-04-10 16:45:33 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-04-10 16:45:33 +0300
commit35d5b1cc47ac444524c087615033d5856f8a5dc3 (patch)
treeea04d67f9254db682e5418ccad43bad873068ea9 /include
parenta5e4a0de5bfa544de0e77ce3bf5443386530d43f (diff)
no need to declare the same template in each protocol
Diffstat (limited to 'include')
-rw-r--r--include/m_protoint.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h
index fff60ea614..4d3a908168 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -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;
+ }
};
/////////////////////////////////////////////////////////////////////////////////////////