summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-10-24 20:31:35 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-10-24 20:31:35 +0300
commit4a86731399f158e08ec272fe9a5fc0f0fa0dbad6 (patch)
tree1dfa56ec4ab92f594ea83989efb52094940e765d /plugins/TabSRMM
parent3737eafbc89c31085e18d21d6db6e71e9515dd52 (diff)
fixes #4756 (Плагины сообшений: отдать доступность кнопок форматирования полностью на откуп протоколу)
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/res/resource.rc15
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp86
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp3
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp9
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp1
-rw-r--r--plugins/TabSRMM/src/msgs.h3
-rw-r--r--plugins/TabSRMM/src/resource.h5
-rw-r--r--plugins/TabSRMM/src/srmm.cpp1
8 files changed, 22 insertions, 101 deletions
diff --git a/plugins/TabSRMM/res/resource.rc b/plugins/TabSRMM/res/resource.rc
index f873a65e0b..9b962ec7e4 100644
--- a/plugins/TabSRMM/res/resource.rc
+++ b/plugins/TabSRMM/res/resource.rc
@@ -663,21 +663,6 @@ BEGIN
MENUITEM "Global", ID_MODE_GLOBAL
MENUITEM "Private", ID_MODE_PRIVATE
END
- MENUITEM SEPARATOR
- POPUP "Send text formatting"
- BEGIN
- POPUP "Global"
- BEGIN
- MENUITEM "BBCode", ID_GLOBAL_BBCODE
- MENUITEM "Off", ID_GLOBAL_OFF
- END
- POPUP "This contact"
- BEGIN
- MENUITEM "Global setting", ID_THISCONTACT_GLOBALSETTING
- MENUITEM "BBCode", ID_THISCONTACT_BBCODE
- MENUITEM "Force off", ID_THISCONTACT_OFF
- END
- END
END
POPUP "Unread menu"
BEGIN
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 562349588c..e17fe07358 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -227,74 +227,31 @@ LRESULT CMsgDialog::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPara
case IDC_PROTOMENU:
submenu = GetSubMenu(PluginConfig.g_hMenuContext, 4);
- {
- bool iOldGlobalSendFormat = g_plugin.bSendFormat;
- int iLocalFormat = M.GetDword(m_hContact, "sendformat", -1);
- int iNewLocalFormat = iLocalFormat;
- GetWindowRect(GetDlgItem(m_hwnd, IDC_PROTOCOL), &rc);
-
- CheckMenuItem(submenu, ID_MODE_GLOBAL, !m_bSplitterOverride ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(submenu, ID_MODE_PRIVATE, m_bSplitterOverride ? MF_CHECKED : MF_UNCHECKED);
-
- // formatting menu..
- CheckMenuItem(submenu, ID_GLOBAL_BBCODE, (g_plugin.bSendFormat) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(submenu, ID_GLOBAL_OFF, (g_plugin.bSendFormat == SENDFORMAT_NONE) ? MF_CHECKED : MF_UNCHECKED);
-
- CheckMenuItem(submenu, ID_THISCONTACT_GLOBALSETTING, (iLocalFormat == SENDFORMAT_NONE) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(submenu, ID_THISCONTACT_BBCODE, (iLocalFormat > 0) ? MF_CHECKED : MF_UNCHECKED);
- CheckMenuItem(submenu, ID_THISCONTACT_OFF, (iLocalFormat == -1) ? MF_CHECKED : MF_UNCHECKED);
-
- iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, m_hwnd, nullptr);
- switch (iSelection) {
- case ID_MODE_GLOBAL:
- m_bSplitterOverride = false;
- db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", 0);
- LoadSplitter();
- AdjustBottomAvatarDisplay();
- DM_RecalcPictureSize();
- Resize();
- break;
-
- case ID_MODE_PRIVATE:
- m_bSplitterOverride = true;
- db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", 1);
- LoadSplitter();
- AdjustBottomAvatarDisplay();
- DM_RecalcPictureSize();
- Resize();
- break;
-
- case ID_GLOBAL_BBCODE:
- g_plugin.bSendFormat = SENDFORMAT_BBCODE;
- break;
-
- case ID_GLOBAL_OFF:
- g_plugin.bSendFormat = SENDFORMAT_NONE;
- break;
+ GetWindowRect(GetDlgItem(m_hwnd, IDC_PROTOCOL), &rc);
- case ID_THISCONTACT_GLOBALSETTING:
- iNewLocalFormat = -1;
- break;
-
- case ID_THISCONTACT_BBCODE:
- iNewLocalFormat = SENDFORMAT_BBCODE;
- break;
+ CheckMenuItem(submenu, ID_MODE_GLOBAL, !m_bSplitterOverride ? MF_CHECKED : MF_UNCHECKED);
+ CheckMenuItem(submenu, ID_MODE_PRIVATE, m_bSplitterOverride ? MF_CHECKED : MF_UNCHECKED);
- case ID_THISCONTACT_OFF:
- iNewLocalFormat = SENDFORMAT_NONE;
- break;
- }
-
- if (iNewLocalFormat == -1)
- db_unset(m_hContact, SRMSGMOD_T, "sendformat");
- else if (iNewLocalFormat != iLocalFormat)
- db_set_dw(m_hContact, SRMSGMOD_T, "sendformat", iNewLocalFormat);
+ iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, m_hwnd, nullptr);
+ switch (iSelection) {
+ case ID_MODE_GLOBAL:
+ m_bSplitterOverride = false;
+ db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", 0);
+ LoadSplitter();
+ AdjustBottomAvatarDisplay();
+ DM_RecalcPictureSize();
+ Resize();
+ break;
- if (iNewLocalFormat != iLocalFormat || g_plugin.bSendFormat != iOldGlobalSendFormat) {
- GetSendFormat();
- Srmm_Broadcast(DM_CONFIGURETOOLBAR, 0, 1);
- }
+ case ID_MODE_PRIVATE:
+ m_bSplitterOverride = true;
+ db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", 1);
+ LoadSplitter();
+ AdjustBottomAvatarDisplay();
+ DM_RecalcPictureSize();
+ Resize();
+ break;
}
break;
@@ -758,7 +715,6 @@ void CMsgDialog::OnOptionsApplied()
}
DM_InitRichEdit();
- GetSendFormat();
if (isChat()) {
m_btnOk.SendMsg(BUTTONSETASNORMAL, TRUE, 0);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 794c4078a3..b213fa3964 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -342,8 +342,6 @@ CMsgDialog::CMsgDialog(int iDlgId, MCONTACT hContact) :
m_btnCancelAdd.OnClick = Callback(this, &CMsgDialog::onClick_CancelAdd);
}
- GetSendFormat();
-
m_szProto = Proto_GetBaseAccountName(m_hContact);
m_autoClose = CLOSE_ON_CANCEL;
m_forceResizable = true;
@@ -2226,7 +2224,6 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_SPLITTERY), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(m_hwnd, IDC_SPLITTERY), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
if (lParam == 1) {
- GetSendFormat();
SetDialogToType();
DM_RecalcPictureSize();
Resize();
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index 10fcd4b601..01eb7c7239 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -971,15 +971,6 @@ LRESULT CMsgDialog::GetSendButtonState()
}
/////////////////////////////////////////////////////////////////////////////////////////
-// reads send format and configures the toolbar buttons
-// if mode == 0, int only configures the buttons and does not change send format
-
-void CMsgDialog::GetSendFormat()
-{
- m_bSendFormat = M.GetDword(m_hContact, "sendformat", g_plugin.bSendFormat) != 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
HICON CMsgDialog::GetXStatusIcon() const
{
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index e1e8f5bec1..f0ba38a0ad 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -402,7 +402,6 @@ public:
treeOpts.AddOption(pwszSection, LPGENW("Minimize the message window on send"), g_plugin.bAutoMin);
treeOpts.AddOption(pwszSection, LPGENW("Close the message window on send"), g_plugin.bAutoClose);
treeOpts.AddOption(pwszSection, LPGENW("Enable \"Paste and send\" feature"), g_plugin.bPasteAndSend);
- treeOpts.AddOption(pwszSection, LPGENW("Allow BBCode formatting in outgoing messages"), g_plugin.bSendFormat);
pwszSection = LPGENW("Other options");
treeOpts.AddOption(pwszSection, LPGENW("Automatically split long messages (experimental, use with care)"), g_plugin.bAutoSplit);
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index e734f5f30e..d336e290cb 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -417,7 +417,6 @@ class CMsgDialog : public CSrmmBaseDialog
void FlashOnClist(MEVENT hEvent, const DB::EventInfo &dbei);
void FlashTab(bool bInvertMode);
LRESULT GetSendButtonState();
- void GetSendFormat(void);
HICON GetXStatusIcon() const;
void HandlePasteAndSend(void);
void LoadContactAvatar(void);
@@ -1030,7 +1029,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
// window settings
CMOption<bool> bAutoMin, bAutoClose, bFlashOnClist, bDeleteTemp;
- CMOption<bool> bPasteAndSend, bSendFormat, bAutoSplit, bUseSameSplitSize, bAutoCopy;
+ CMOption<bool> bPasteAndSend, bAutoSplit, bUseSameSplitSize, bAutoCopy;
CMOption<bool> bStatusOnTabs, bUseXStatus, bDetailedTooltips, bAllowOfflineMultisend;
CMOption<bool> bAutoPopup, bAutoTabs, bAutoSwitchTabs, bAutoContainer, bPopupContainer, bHideOnClose, bAllowTab;
diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h
index 50b07bab75..5f7e8be30f 100644
--- a/plugins/TabSRMM/src/resource.h
+++ b/plugins/TabSRMM/src/resource.h
@@ -662,11 +662,6 @@
#define ID_MODE_GLOBAL 40148
#define ID_MODE_PRIVATE 40150
#define ID_VIEW_BOTTOMTOOLBAR 40171
-#define ID_GLOBAL_OFF 40172
-#define ID_THISCONTACT_GLOBALSETTING 40174
-#define ID_THISCONTACT_BBCODE 40175
-#define ID_THISCONTACT_OFF 40177
-#define ID_GLOBAL_BBCODE 40178
#define ID_LOG_FREEZELOG 40183
#define ID_SENDMENU_SENDWITHOUTTIMEOUTS 40203
#define ID_VIEW_INFOPANEL 40208
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp
index 228b8e936d..1657af8321 100644
--- a/plugins/TabSRMM/src/srmm.cpp
+++ b/plugins/TabSRMM/src/srmm.cpp
@@ -64,7 +64,6 @@ CMPlugin::CMPlugin() :
bAutoSplit(SRMSGMOD_T, "autosplit", false),
bDeleteTemp(SRMSGMOD_T, "deletetemp", false),
bUseXStatus(SRMSGMOD_T, "use_xicons", true),
- bSendFormat(SRMSGMOD_T, "sendformat", false),
bHideOnClose(SRMSGMOD_T, "hideonclose", false),
bStatusOnTabs(SRMSGMOD_T, "tabstatus", true),
bFlashOnClist(SRMSGMOD_T, "flashcl", false),