From 42706272085db04de11ba586e3e2c8a507e7af0d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Mar 2018 13:48:24 +0300 Subject: fixes #1212 (virtual protocols contacts) --- plugins/NewsAggregator/Src/NewsAggregator.cpp | 2 ++ plugins/Non-IM Contact/src/main.cpp | 2 ++ plugins/Quotes/src/Forex.cpp | 15 +++++++++++++++ plugins/Weather/src/weather.cpp | 2 ++ plugins/YAMN/src/main.cpp | 2 ++ src/mir_app/src/newplugins.cpp | 2 +- 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp index e30d9b7f02..ab1ac2f830 100644 --- a/plugins/NewsAggregator/Src/NewsAggregator.cpp +++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp @@ -48,6 +48,8 @@ bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) return TRUE; } +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index 209967923b..43123d7a3f 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -83,6 +83,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) return &pluginInfoEx; } +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; + //===================================================== // Name : WINAPI DllMain // Parameters: HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index c8eb6d0a04..28e645cdea 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -236,6 +236,18 @@ int QuotesEventFunc_OnContactDeleted(WPARAM wParam, LPARAM) return 0; } +INT_PTR QuoteProtoFunc_GetCaps(WPARAM wParam, LPARAM) +{ + switch (wParam) { + case PFLAG_UNIQUEIDTEXT: + return (INT_PTR)Translate("Quote Symbol"); + case PFLAG_UNIQUEIDSETTING: + return (INT_PTR)DB_STR_QUOTE_SYMBOL; + } + + return 0; +} + INT_PTR QuoteProtoFunc_GetStatus(WPARAM, LPARAM) { return g_bAutoUpdate ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE; @@ -286,6 +298,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) return TRUE; } +EXTERN_C __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; + EXTERN_C __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &Global_pluginInfo; @@ -307,6 +321,7 @@ EXTERN_C int __declspec(dllexport) Load(void) pd.type = PROTOTYPE_VIRTUAL; Proto_RegisterModule(&pd); + CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_GETCAPS, QuoteProtoFunc_GetCaps); CreateProtoServiceFunction(QUOTES_PROTOCOL_NAME, PS_GETSTATUS, QuoteProtoFunc_GetStatus); HookEvent(ME_SYSTEM_MODULESLOADED, QuotesEventFunc_OnModulesLoaded); diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index fad7fa65aa..8ea8f6605f 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -73,6 +73,8 @@ static const PLUGININFOEX pluginInfoEx = {0x6b612a34, 0xdcf2, 0x4e32, {0x85, 0xcf, 0xb6, 0xfd, 0x0, 0x6b, 0x74, 0x5e}} }; +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; + extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index ef98f4f27e..e34ed9b6ea 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -90,6 +90,8 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) ///////////////////////////////////////////////////////////////////////////////////////// +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfo; diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index f9ff40338f..29346eadc1 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -487,7 +487,7 @@ pluginEntry* OpenPlugin(wchar_t *tszFileName, wchar_t *dir, wchar_t *path) // didn't have basic APIs or DB exports - failed. p->bFailed = true; } - else if (hasMuuid(pIds, MIID_PROTOCOL)) + else if (hasMuuid(pIds, MIID_PROTOCOL) || !mir_wstrcmpi(tszFileName, L"mradio.dll") || !mir_wstrcmpi(tszFileName, L"watrack.dll")) p->bIsProtocol = true; return p; } -- cgit v1.2.3