From 895b9e0ea5191b67d3f39406c9eae15ccde056ef Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 20 Apr 2015 19:05:33 +0000 Subject: SkypeWeb: fixed parseing uri hook git-svn-id: http://svn.miranda-ng.org/main/trunk@12984 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/common.h | 4 +--- protocols/SkypeWeb/src/main.cpp | 7 +++---- protocols/SkypeWeb/src/skype_proto.h | 3 ++- protocols/SkypeWeb/src/skype_utils.cpp | 11 ++++++++++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/protocols/SkypeWeb/src/common.h b/protocols/SkypeWeb/src/common.h index 85191fd8da..6e85e35f10 100644 --- a/protocols/SkypeWeb/src/common.h +++ b/protocols/SkypeWeb/src/common.h @@ -87,7 +87,7 @@ struct CSkypeProto; extern HINSTANCE g_hInstance; -#define MODULE "SKYPE" +#define MODULE "Skype" #define SKYPE_MAX_CONNECT_RETRIES 10 @@ -100,8 +100,6 @@ enum SKYPE_LOGIN_ERROR #define SKYPE_SETTINGS_PASSWORD "Password" #define SKYPE_SETTINGS_GROUP "DefaultGroup" -#define SKYPE_PARSEURI "SKYPE/ParseUri" - #define SKYPE_DB_EVENT_TYPE_ACTION 10001 #endif //_COMMON_H_ \ No newline at end of file diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp index 80c8363e1a..5bef640a73 100644 --- a/protocols/SkypeWeb/src/main.cpp +++ b/protocols/SkypeWeb/src/main.cpp @@ -60,7 +60,7 @@ extern "C" int __declspec(dllexport) Load(void) mir_getCLI(); PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; - pd.szName = MODULE; + pd.szName = "SKYPE"; pd.type = PROTOTYPE_PROTOCOL; pd.fnInit = (pfnInitProto)CSkypeProto::InitAccount; pd.fnUninit = (pfnUninitProto)CSkypeProto::UninitAccount; @@ -72,7 +72,6 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_SYSTEM_MODULESLOADED, &CSkypeProto::OnModulesLoaded); - return 0; } @@ -89,8 +88,8 @@ int CSkypeProto::OnModulesLoaded(WPARAM, LPARAM) { if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) { - CreateServiceFunction(SKYPE_PARSEURI, GlobalService<&CSkypeProto::ParseSkypeURIService>); - AssocMgr_AddNewUrlTypeT("skype:", TranslateT("Skype Link Protocol"), g_hInstance, IDI_SKYPE, SKYPE_PARSEURI, 0); + CreateServiceFunction(MODULE "/ParseUri", CSkypeProto::GlobalParseSkypeUriService); + AssocMgr_AddNewUrlTypeT("skype:", TranslateT("Skype Link Protocol"), g_hInstance, IDI_SKYPE, MODULE "/ParseUri", 0); } return 0; } \ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 8043b87a7c..4e01934d88 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -277,7 +277,8 @@ private: char *SelfUrlToName(const char *url); char *GetServerFromUrl(const char *url); - INT_PTR __cdecl CSkypeProto::ParseSkypeURIService(WPARAM, LPARAM lParam); + INT_PTR __cdecl ParseSkypeUriService(WPARAM, LPARAM lParam); + static INT_PTR __cdecl GlobalParseSkypeUriService(WPARAM, LPARAM lParam); template static INT_PTR __cdecl GlobalService(WPARAM wParam, LPARAM lParam) diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp index d8a881868e..cbc5086cba 100644 --- a/protocols/SkypeWeb/src/skype_utils.cpp +++ b/protocols/SkypeWeb/src/skype_utils.cpp @@ -517,7 +517,7 @@ char *CSkypeProto::GetServerFromUrl(const char *url) return ParseUrl(url, "://"); } -INT_PTR __cdecl CSkypeProto::ParseSkypeURIService(WPARAM wParam, LPARAM lParam) +INT_PTR CSkypeProto::ParseSkypeUriService(WPARAM, LPARAM lParam) { TCHAR *arg = (TCHAR *)lParam; if (arg == NULL) @@ -557,4 +557,13 @@ INT_PTR __cdecl CSkypeProto::ParseSkypeURIService(WPARAM wParam, LPARAM lParam) } return 1; /* parse failed */ +} + +INT_PTR CSkypeProto::GlobalParseSkypeUriService(WPARAM wParam, LPARAM lParam) +{ + for (int i = 0; i < Accounts.getCount(); i++) + if (Accounts[i]->IsOnline()) + return Accounts[i]->ParseSkypeUriService(wParam, lParam); + + return 1; } \ No newline at end of file -- cgit v1.2.3