summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_protoint.h7
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h9
-rw-r--r--protocols/Steam/src/steam_menus.cpp13
-rw-r--r--protocols/Steam/src/steam_proto.h6
-rw-r--r--protocols/Teams/src/teams_proto.h7
-rw-r--r--protocols/Twitter/src/main.cpp2
-rw-r--r--protocols/Twitter/src/proto.h1
-rw-r--r--protocols/Twitter/src/theme.cpp9
-rw-r--r--protocols/Twitter/src/theme.h1
9 files changed, 17 insertions, 38 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;
+ }
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index e81c733f31..d6528c20d4 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -35,7 +35,7 @@ struct CSkypeTransfer
int iFileSize = 0, iWidth = -1, iHeight = -1;
};
-struct CSkypeProto : public PROTO <CSkypeProto>
+struct CSkypeProto : public PROTO<CSkypeProto>
{
friend class CSkypeOptionsMain;
friend class CSkypeGCCreateDlg;
@@ -359,13 +359,6 @@ private:
INT_PTR __cdecl SvcCreateChat(WPARAM, LPARAM);
INT_PTR __cdecl SvcSetMood(WPARAM, LPARAM);
INT_PTR __cdecl ParseSkypeUriService(WPARAM, LPARAM lParam);
-
- template<INT_PTR(__cdecl CSkypeProto::*Service)(WPARAM, LPARAM)>
- static INT_PTR __cdecl GlobalService(WPARAM wParam, LPARAM lParam)
- {
- CSkypeProto *proto = CMPlugin::getInstance((MCONTACT)wParam);
- return proto ? (proto->*Service)(wParam, lParam) : 0;
- }
};
typedef CProtoDlgBase<CSkypeProto> CSkypeDlgBase;
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp
index d82d3e46cf..1926c27179 100644
--- a/protocols/Steam/src/steam_menus.cpp
+++ b/protocols/Steam/src/steam_menus.cpp
@@ -3,13 +3,6 @@
int CSteamProto::hChooserMenu;
HGENMENU CSteamProto::contactMenuItems[CMI_MAX];
-template<int(__cdecl CSteamProto::*Service)(WPARAM, LPARAM)>
-INT_PTR GlobalService(WPARAM hContact, LPARAM lParam)
-{
- CSteamProto *ppro = CMPlugin::getInstance((MCONTACT)hContact);
- return ppro ? (ppro->*Service)(hContact, lParam) : 0;
-}
-
INT_PTR CSteamProto::AuthRequestCommand(WPARAM hContact, LPARAM)
{
ProtoChainSend(hContact, PSS_AUTHREQUEST, 0, 0);
@@ -22,19 +15,19 @@ INT_PTR CSteamProto::AuthRevokeCommand(WPARAM hContact, LPARAM)
return 0;
}
-int CSteamProto::BlockCommand(WPARAM hContact, LPARAM)
+INT_PTR CSteamProto::BlockCommand(WPARAM hContact, LPARAM)
{
SendUserIgnoreRequest(hContact, true);
return 0;
}
-int CSteamProto::UnblockCommand(WPARAM hContact, LPARAM)
+INT_PTR CSteamProto::UnblockCommand(WPARAM hContact, LPARAM)
{
SendUserIgnoreRequest(hContact, false);
return 0;
}
-int CSteamProto::JoinToGameCommand(WPARAM hContact, LPARAM)
+INT_PTR CSteamProto::JoinToGameCommand(WPARAM hContact, LPARAM)
{
char url[MAX_PATH];
uint32_t gameId = getDword(hContact, "GameID", 0);
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index 360a7403b3..f21bcb4869 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -300,9 +300,9 @@ class CSteamProto : public PROTO<CSteamProto>
INT_PTR __cdecl AuthRequestCommand(WPARAM, LPARAM);
INT_PTR __cdecl AuthRevokeCommand(WPARAM, LPARAM);
- int __cdecl BlockCommand(WPARAM, LPARAM);
- int __cdecl UnblockCommand(WPARAM, LPARAM);
- int __cdecl JoinToGameCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl BlockCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl UnblockCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl JoinToGameCommand(WPARAM, LPARAM);
INT_PTR __cdecl OpenBlockListCommand(WPARAM, LPARAM);
diff --git a/protocols/Teams/src/teams_proto.h b/protocols/Teams/src/teams_proto.h
index c6ad876e86..2cff3431e3 100644
--- a/protocols/Teams/src/teams_proto.h
+++ b/protocols/Teams/src/teams_proto.h
@@ -341,13 +341,6 @@ private:
INT_PTR __cdecl SvcSetMood(WPARAM, LPARAM);
INT_PTR __cdecl ParseSkypeUriService(WPARAM, LPARAM lParam);
- template<INT_PTR(__cdecl CTeamsProto::*Service)(WPARAM, LPARAM)>
- static INT_PTR __cdecl GlobalService(WPARAM wParam, LPARAM lParam)
- {
- auto *proto = CMPlugin::getInstance((MCONTACT)wParam);
- return proto ? (proto->*Service)(wParam, lParam) : 0;
- }
-
// trouter
public:
void TRouterProcess(const char *str);
diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp
index ddfca4e698..cbbbb3ae14 100644
--- a/protocols/Twitter/src/main.cpp
+++ b/protocols/Twitter/src/main.cpp
@@ -54,7 +54,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
int CMPlugin::Load()
{
InitIcons();
- InitContactMenus();
+ CTwitterProto::InitContactMenus();
TwitterInitSounds();
return 0;
}
diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h
index 0b91476259..0945761c82 100644
--- a/protocols/Twitter/src/proto.h
+++ b/protocols/Twitter/src/proto.h
@@ -189,6 +189,7 @@ public:
void OnModulesLoaded() override;
void UpdateSettings();
+ static void InitContactMenus(void);
//////////////////////////////////////////////////////////////////////////////////////
// Services
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp
index 378e57447e..7470ea1a38 100644
--- a/protocols/Twitter/src/theme.cpp
+++ b/protocols/Twitter/src/theme.cpp
@@ -55,13 +55,6 @@ static HGENMENU g_hMenuItems[2];
// Helper functions
-template<INT_PTR(__cdecl CTwitterProto::*Fcn)(WPARAM, LPARAM)>
-INT_PTR GlobalService(WPARAM hContact, LPARAM lParam)
-{
- CTwitterProto *proto = CMPlugin::getInstance(MCONTACT(hContact));
- return proto ? (proto->*Fcn)(hContact, lParam) : 0;
-}
-
static int PrebuildContactMenu(WPARAM hContact, LPARAM lParam)
{
ShowContactMenus(false);
@@ -70,7 +63,7 @@ static int PrebuildContactMenu(WPARAM hContact, LPARAM lParam)
return proto ? proto->OnPrebuildContactMenu(hContact, lParam) : 0;
}
-void InitContactMenus()
+void CTwitterProto::InitContactMenus()
{
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
diff --git a/protocols/Twitter/src/theme.h b/protocols/Twitter/src/theme.h
index 6bd91241fd..5aed016764 100644
--- a/protocols/Twitter/src/theme.h
+++ b/protocols/Twitter/src/theme.h
@@ -21,6 +21,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void InitIcons(void);
HANDLE GetIconHandle(const char *name);
-void InitContactMenus(void);
void ShowContactMenus(bool show);
void TwitterInitSounds(void); \ No newline at end of file