diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-07 22:38:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-07 22:40:54 +0300 |
commit | 6712ce9307350ef5c04f184b0cb80cfe75af77c5 (patch) | |
tree | 3baa482fecc7e53c7843e8ae89a6bc6678b0570d /plugins/MirOTR | |
parent | fab3905d91890102046dcc4554721991ae8ff413 (diff) |
Srmm_ModifyIcon now changes only tooltip and/or icon, Srmm_SetIconFlags controls flags
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r-- | plugins/MirOTR/src/svcs_srmm.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp index 5e006e7841..1a4da8b146 100644 --- a/plugins/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/src/svcs_srmm.cpp @@ -24,35 +24,27 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level) bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0)); BBButton button = OTRButton; - - StatusIconData sid = {}, sid2 = {}; - sid.szModule = MODULENAME; - sid.dwId = 0; - sid.flags = MBF_HIDDEN; - - sid2.szModule = MODULENAME; - sid2.dwId = 1; - sid2.flags = MBF_HIDDEN; + int flags1 = MBF_HIDDEN, flags2 = MBF_HIDDEN; if (!chat_room) { switch (level) { case TRUST_FINISHED: - sid.flags = 0; + flags1 = 0; button.pwszTooltip = TranslateW(LANG_STATUS_FINISHED); button.hIcon = iconList[ICON_FINISHED].hIcolib; break; case TRUST_UNVERIFIED: - sid2.flags = MBF_DISABLED; + flags2 = MBF_DISABLED; button.pwszTooltip = TranslateW(LANG_STATUS_UNVERIFIED); button.hIcon = iconList[ICON_UNVERIFIED].hIcolib; break; case TRUST_PRIVATE: - sid2.flags = 0; + flags2 = 0; button.pwszTooltip = TranslateW(LANG_STATUS_PRIVATE); button.hIcon = iconList[ICON_PRIVATE].hIcolib; break; default: - sid.flags = MBF_DISABLED; + flags1 = MBF_DISABLED; button.pwszTooltip = TranslateW(LANG_STATUS_DISABLED); button.hIcon = iconList[ICON_NOT_PRIVATE].hIcolib; break; @@ -61,8 +53,8 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level) } else button.bbbFlags = BBSF_HIDDEN; - Srmm_ModifyIcon(hContact, &sid); - Srmm_ModifyIcon(hContact, &sid2); + Srmm_SetIconFlags(hContact, MODULENAME, 0, flags1); + Srmm_SetIconFlags(hContact, MODULENAME, 1, flags2); Srmm_SetButtonState(hContact, &button); g_plugin.setDword(hContact, "TrustLevel", level); |