summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-02-21 12:07:26 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-02-21 12:07:26 +0000
commit1f59d862f624b14135eaf16899d3bc617fa3ff1e (patch)
tree4959ee2d2c49771e9626bda78ea5df66d389f21b
parent70d06b6ba6483e65aa036d9579c8716c86e5c909 (diff)
hooking loading/unloading popups plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@3668 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/IcqOscarJ/src/icq_opts.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_popups.cpp10
-rw-r--r--protocols/IcqOscarJ/src/icq_popups.h3
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp2
-rw-r--r--protocols/IcqOscarJ/src/init.cpp10
5 files changed, 14 insertions, 13 deletions
diff --git a/protocols/IcqOscarJ/src/icq_opts.cpp b/protocols/IcqOscarJ/src/icq_opts.cpp
index 3210593753..e43d1dc719 100644
--- a/protocols/IcqOscarJ/src/icq_opts.cpp
+++ b/protocols/IcqOscarJ/src/icq_opts.cpp
@@ -606,7 +606,7 @@ int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM lParam)
odp.pfnDlgProc = DlgProcIcqPrivacyOpts;
Options_AddPage(wParam, &odp);
- if (ServiceExists(MS_POPUP_ADDPOPUP)) {
+ if (bPopUpService) {
odp.position = 100000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUPS);
odp.groupPosition = 900000000;
diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp
index 1420cd4365..cee5509a7c 100644
--- a/protocols/IcqOscarJ/src/icq_popups.cpp
+++ b/protocols/IcqOscarJ/src/icq_popups.cpp
@@ -29,15 +29,7 @@
// -----------------------------------------------------------------------------
#include "icqoscar.h"
-BOOL bPopUpService = FALSE;
-
-void InitPopUps()
-{
- if (ServiceExists(MS_POPUP_ADDPOPUPEX))
- {
- bPopUpService = TRUE;
- }
-}
+extern BOOL bPopUpService;
static const UINT icqPopupsControls[] = {
IDC_POPUPS_LOG_ENABLED, IDC_POPUPS_SPAM_ENABLED, IDC_PREVIEW, IDC_USESYSICONS, IDC_POPUP_LOG0_TIMEOUT,
diff --git a/protocols/IcqOscarJ/src/icq_popups.h b/protocols/IcqOscarJ/src/icq_popups.h
index a42c230634..95e997a826 100644
--- a/protocols/IcqOscarJ/src/icq_popups.h
+++ b/protocols/IcqOscarJ/src/icq_popups.h
@@ -33,8 +33,7 @@
#define POPTYPE_SPAM 254 // this is for spambots
-
-void InitPopUps();
+int ModuleLoad(WPARAM, LPARAM);
void InitPopupOpts(WPARAM wParam);
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 2b8293ef0a..ceb9363eb8 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -311,7 +311,7 @@ int CIcqProto::OnModulesLoaded( WPARAM wParam, LPARAM lParam )
InitAvatars();
// Init extra optional modules
- InitPopUps();
+ ModuleLoad(0, 0);
InitXStatusItems(FALSE);
HANDLE hContact = FindFirstContact();
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp
index 2489646844..45bbc15bec 100644
--- a/protocols/IcqOscarJ/src/init.cpp
+++ b/protocols/IcqOscarJ/src/init.cpp
@@ -35,6 +35,7 @@
HINSTANCE hInst;
int hLangpack;
CLIST_INTERFACE *pcli;
+BOOL bPopUpService = FALSE;
HANDLE hExtraXStatus;
@@ -88,6 +89,12 @@ IconItem g_IconsList[4] =
{ LPGEN("Add to server list"), "add_to_server", IDI_SERVLIST_ADD }
};
+int ModuleLoad(WPARAM wParam, LPARAM lParam)
+{
+ bPopUpService = ServiceExists(MS_POPUP_ADDPOPUPEX) != 0;
+ return 0;
+}
+
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP( &pluginInfo );
@@ -118,6 +125,9 @@ extern "C" int __declspec(dllexport) Load(void)
InitXStatusIcons();
HookEvent(ME_SKIN2_ICONSCHANGED, OnReloadIcons);
+ HookEvent(ME_SYSTEM_MODULELOAD, ModuleLoad);
+ HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad);
+
hExtraXStatus = ExtraIcon_Register("xstatus", "ICQ XStatus", "icq_xstatus13");
g_MenuInit();