From 1e857963fa96c1e2131fa799d8580c526f175cee Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 8 Jan 2019 20:17:56 +0200 Subject: fixes #1734 (dynamic plugin's presence checker) --- protocols/JabberG/src/jabber.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 7e53cc2fed..3cb8afcb14 100755 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -88,18 +88,21 @@ static INT_PTR g_SvcParseXmppUri(WPARAM w, LPARAM l) return 0; } -static int OnModulesLoaded(WPARAM, LPARAM) +static int OnLoadModule(WPARAM, LPARAM) { - HookEvent(ME_TTB_MODULELOADED, g_OnToolbarInit); - bSecureIM = ServiceExists("SecureIM/IsContactSecured") != 0; bMirOTR = GetModuleHandle(L"mirotr.dll") != nullptr; bNewGPG = GetModuleHandle(L"new_gpg.dll") != nullptr; - #ifdef _WIN64 - bPlatform = 1; - #else - bPlatform = 0; - #endif + return 0; +} + +static int OnModulesLoaded(WPARAM, LPARAM) +{ + HookEvent(ME_TTB_MODULELOADED, g_OnToolbarInit); + + HookEvent(ME_SYSTEM_MODULELOAD, OnLoadModule); + HookEvent(ME_SYSTEM_MODULEUNLOAD, OnLoadModule); + OnLoadModule(0, 0); // file associations manager plugin support if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) { @@ -147,6 +150,12 @@ static int OnModulesLoaded(WPARAM, LPARAM) int CMPlugin::Load() { + #ifdef _WIN64 + bPlatform = 1; + #else + bPlatform = 0; + #endif + char mirVer[100]; Miranda_GetVersionText(mirVer, _countof(mirVer)); mir_wstrcpy(szCoreVersion, _A2T(mirVer)); -- cgit v1.2.3