summaryrefslogtreecommitdiff
path: root/plugins/MirOTR
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-01 20:51:42 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-01 21:49:54 +0300
commitf9c7760f54c279327a977b0cb5ee028c8f0c0bfb (patch)
tree0a1cf4602a5eac89dc38606cc91981c2166a83e0 /plugins/MirOTR
parent40203d30ad1a569cfea61442782393b200e9fbe3 (diff)
more fixes
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r--plugins/MirOTR/src/options.cpp1
-rw-r--r--plugins/MirOTR/src/options.h2
-rw-r--r--plugins/MirOTR/src/svcs_srmm.cpp30
3 files changed, 15 insertions, 18 deletions
diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp
index f0382af233..ea2050bbf6 100644
--- a/plugins/MirOTR/src/options.cpp
+++ b/plugins/MirOTR/src/options.cpp
@@ -89,7 +89,6 @@ void LoadOptions()
options.bHavePopups = 0 != ServiceExists(MS_POPUP_ADDPOPUPT) && ServiceExists(MS_POPUP_SHOWMESSAGE);
options.bHaveSecureIM = 0 != ServiceExists("SecureIM/IsContactSecured");
- options.bHaveButtonsBar = 0 != ServiceExists(MS_BB_ADDBUTTON);
LoadFilenames();
}
diff --git a/plugins/MirOTR/src/options.h b/plugins/MirOTR/src/options.h
index 1aca058985..17efb1c139 100644
--- a/plugins/MirOTR/src/options.h
+++ b/plugins/MirOTR/src/options.h
@@ -32,7 +32,7 @@ typedef struct {
bool end_offline, end_window_close;
// temporary options
- bool bHavePopups, bHaveSecureIM, bHaveButtonsBar;
+ bool bHavePopups, bHaveSecureIM;
} Options;
diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp
index 485f7b73bb..882d0eaf70 100644
--- a/plugins/MirOTR/src/svcs_srmm.cpp
+++ b/plugins/MirOTR/src/svcs_srmm.cpp
@@ -65,8 +65,8 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level)
Srmm_ModifyIcon(hContact, &sid);
Srmm_ModifyIcon(hContact, &sid2);
+ Srmm_SetButtonState(hContact, &button);
- if (options.bHaveButtonsBar) CallService(MS_BB_SETBUTTONSTATE, hContact, (LPARAM)&button);
db_set_dw(hContact, MODULENAME, "TrustLevel", level);
if (!chat_room) {
@@ -88,14 +88,14 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level)
int SVC_ButtonsBarLoaded(WPARAM, LPARAM)
{
- CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&OTRButton);
+ Srmm_AddButton(&OTRButton);
return 0;
}
int SVC_ButtonsBarPressed(WPARAM w, LPARAM l)
{
- CustomButtonClickData* cbcd = (CustomButtonClickData *)l;
- if (cbcd->cbSize == sizeof(CustomButtonClickData) && cbcd->dwButtonId == 0 && mir_strcmp(cbcd->pszModule, MODULENAME)==0) {
+ CustomButtonClickData *cbcd = (CustomButtonClickData *)l;
+ if (cbcd->dwButtonId == 0 && !mir_strcmp(cbcd->pszModule, MODULENAME)) {
MCONTACT hContact = (MCONTACT)w;
char *proto = GetContactProto(hContact);
@@ -133,19 +133,17 @@ void InitSRMM()
// hook the window events so that we can can change the status of the icon
HookEvent(ME_MSG_ICONPRESSED, SVC_IconPressed);
- if (options.bHaveButtonsBar) {
- memset(&OTRButton, 0, sizeof(OTRButton));
- OTRButton.cbSize = sizeof(OTRButton);
- OTRButton.dwButtonID = 0;
- OTRButton.pszModuleName = MODULENAME;
- OTRButton.dwDefPos = 200;
- OTRButton.bbbFlags = BBBF_ISRSIDEBUTTON|BBBF_CANBEHIDDEN|BBBF_ISIMBUTTON;
- OTRButton.pwszTooltip = TranslateT(LANG_OTR_TOOLTIP);
- OTRButton.hIcon = IcoLib_GetIconHandle(ICON_NOT_PRIVATE);
- HookEvent(ME_MSG_TOOLBARLOADED, SVC_ButtonsBarLoaded);
- HookEvent(ME_MSG_BUTTONPRESSED, SVC_ButtonsBarPressed);
- }
+ memset(&OTRButton, 0, sizeof(OTRButton));
+ OTRButton.pszModuleName = MODULENAME;
+ OTRButton.dwDefPos = 200;
+ OTRButton.bbbFlags = BBBF_ISRSIDEBUTTON | BBBF_CANBEHIDDEN | BBBF_ISIMBUTTON;
+ OTRButton.pwszTooltip = TranslateT(LANG_OTR_TOOLTIP);
+ OTRButton.hIcon = IcoLib_GetIconHandle(ICON_NOT_PRIVATE);
+
+ HookEvent(ME_MSG_TOOLBARLOADED, SVC_ButtonsBarLoaded);
+ HookEvent(ME_MSG_BUTTONPRESSED, SVC_ButtonsBarPressed);
}
+
void DeinitSRMM()
{
IcoLib_Release(ICON_NOT_PRIVATE, 0);