summaryrefslogtreecommitdiff
path: root/plugins/QuickReplies/src/events.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-04-03 12:10:10 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-04-03 12:10:10 +0300
commitfa5c1b20964e669cf50de378d02ed72c5f9d789b (patch)
treee7d2610c04b143861ed899d2e78025decc26ea90 /plugins/QuickReplies/src/events.cpp
parentb9be36f5e588c4de4fb83933fe81dd2b2ab2f180 (diff)
Quick Replies:
- perversion with copying dlls removed; - click on the Options button now leads to the correct options page; - bunch of old crap removed; - version bump
Diffstat (limited to 'plugins/QuickReplies/src/events.cpp')
-rw-r--r--plugins/QuickReplies/src/events.cpp38
1 files changed, 6 insertions, 32 deletions
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp
index 73f918c9d7..73a8172070 100644
--- a/plugins/QuickReplies/src/events.cpp
+++ b/plugins/QuickReplies/src/events.cpp
@@ -21,32 +21,14 @@ Boston, MA 02111-1307, USA.
using namespace std;
-BYTE iNumber;
-
-HANDLE hOnOptInitialized;
-HANDLE hOnButtonPressed;
-HANDLE hQuickRepliesService;
-
-INT_PTR QuickRepliesService(WPARAM, LPARAM)
-{
- return TRUE;
-}
-
static IconItem icon = { LPGEN("Button"), "qr_button", IDI_QICON };
+int iNumber = 0;
+
int OnModulesLoaded(WPARAM, LPARAM)
{
- UnhookEvent(hOnModulesLoaded);
-
- if (!ServiceExists(MS_QUICKREPLIES_SERVICE)) {
- iNumber = 0;
- hQuickRepliesService = CreateServiceFunction(MS_QUICKREPLIES_SERVICE, QuickRepliesService);
- }
- else iNumber = db_get_b(NULL, MODULE, "InstancesCount", 0);
- db_set_b(NULL, MODULE, "InstancesCount", iNumber + 1);
-
- hOnOptInitialized = HookEvent(ME_OPT_INITIALISE, OnOptInitialized);
- hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
+ HookEvent(ME_OPT_INITIALISE, OnOptInitialized);
+ HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
Icon_Register(hInstance, "TabSRMM/Quick Replies", &icon, 1);
@@ -57,7 +39,7 @@ int OnModulesLoaded(WPARAM, LPARAM)
BBButton bbd = {};
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON;
bbd.pszModuleName = buttonName;
- bbd.pwszTooltip = LPGENW("Quick Replies\r\nLeft button - open menu\r\nRight button - options page");
+ bbd.pwszTooltip = LPGENW("Quick Replies");
bbd.hIcon = icon.hIcolib;
bbd.dwButtonID = iNumber;
bbd.dwDefPos = 220;
@@ -83,7 +65,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam)
if (count == 0 || cbcd->flags & BBCF_RIGHTBUTTON) {
mir_snprintf(buttonName, "%s %x", Translate("Button"), iNumber + 1);
- Options_Open(L"Message Sessions", L"Quick Replies", _A2T(buttonName));
+ Options_Open(L"Message sessions", L"Quick Replies", _A2T(buttonName));
return 0;
}
@@ -121,11 +103,3 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam)
return 1;
}
-
-int OnPreShutdown(WPARAM, LPARAM)
-{
- UnhookEvent(hOnButtonPressed);
- UnhookEvent(hOnOptInitialized);
- UnhookEvent(hOnPreShutdown);
- return 0;
-}