diff options
author | George Hazan <ghazan@miranda.im> | 2016-12-01 20:51:42 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2016-12-01 21:49:54 +0300 |
commit | f9c7760f54c279327a977b0cb5ee028c8f0c0bfb (patch) | |
tree | 0a1cf4602a5eac89dc38606cc91981c2166a83e0 /plugins/QuickReplies | |
parent | 40203d30ad1a569cfea61442782393b200e9fbe3 (diff) |
more fixes
Diffstat (limited to 'plugins/QuickReplies')
-rw-r--r-- | plugins/QuickReplies/src/events.cpp | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 1839bc891a..121d9a56ae 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -48,25 +48,21 @@ int OnModulesLoaded(WPARAM, LPARAM) hOnOptInitialized = HookEvent(ME_OPT_INITIALISE, OnOptInitialized);
hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
- if ( ServiceExists(MS_BB_ADDBUTTON)) {
- Icon_Register(hInstance, "TabSRMM/Quick Replies", &icon, 1);
-
- char buttonNameTranslated[32], buttonName[32];
- mir_snprintf(buttonNameTranslated, "%s %x", Translate("Button"), iNumber + 1);
- mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
-
- BBButton bbd = {0};
- bbd.cbSize = sizeof(BBButton);
- 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.hIcon = icon.hIcolib;
- bbd.dwButtonID = iNumber;
- bbd.dwDefPos = 220;
-
- CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
- }
+ Icon_Register(hInstance, "TabSRMM/Quick Replies", &icon, 1);
+
+ char buttonNameTranslated[32], buttonName[32];
+ mir_snprintf(buttonNameTranslated, "%s %x", Translate("Button"), iNumber + 1);
+ mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
+
+ 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.hIcon = icon.hIcolib;
+ bbd.dwButtonID = iNumber;
+ bbd.dwDefPos = 220;
+ Srmm_AddButton(&bbd);
return 0;
}
@@ -139,18 +135,6 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) int OnPreShutdown(WPARAM, LPARAM)
{
- if (ServiceExists(MS_BB_REMOVEBUTTON))
- {
- char buttonName[32];
- mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
-
- BBButton bbd = {0};
- bbd.cbSize = sizeof(BBButton);
- bbd.pszModuleName = buttonName;
- bbd.dwButtonID = iNumber;
-
- CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bbd);
- }
UnhookEvent(hOnButtonPressed);
UnhookEvent(hOnOptInitialized);
UnhookEvent(hOnPreShutdown);
|