From 4a86731399f158e08ec272fe9a5fc0f0fa0dbad6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 24 Oct 2024 20:31:35 +0300 Subject: =?UTF-8?q?fixes=20#4756=20(=D0=9F=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD?= =?UTF-8?q?=D1=8B=20=D1=81=D0=BE=D0=BE=D0=B1=D1=88=D0=B5=D0=BD=D0=B8=D0=B9?= =?UTF-8?q?:=20=D0=BE=D1=82=D0=B4=D0=B0=D1=82=D1=8C=20=D0=B4=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=83=D0=BF=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=BA=D0=BD?= =?UTF-8?q?=D0=BE=D0=BF=D0=BE=D0=BA=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BD=D0=BE=D1=81=D1=82=D1=8C=D1=8E=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BA=D1=83=D0=BF=20=D0=BF=D1=80=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=BA=D0=BE=D0=BB=D1=83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Scriver/res/resource.rc | 2 - plugins/Scriver/src/msgdialog.cpp | 1 - plugins/Scriver/src/msgoptions.cpp | 4 +- plugins/Scriver/src/resource.h | 1 - plugins/Scriver/src/srmm.cpp | 1 - plugins/Scriver/src/stdafx.h | 2 +- plugins/TabSRMM/res/resource.rc | 15 ----- plugins/TabSRMM/src/generic_msghandlers.cpp | 86 +++++++---------------------- plugins/TabSRMM/src/msgdialog.cpp | 3 - plugins/TabSRMM/src/msgdlgother.cpp | 9 --- plugins/TabSRMM/src/msgoptions.cpp | 1 - plugins/TabSRMM/src/msgs.h | 3 +- plugins/TabSRMM/src/resource.h | 5 -- plugins/TabSRMM/src/srmm.cpp | 1 - 14 files changed, 24 insertions(+), 110 deletions(-) (limited to 'plugins') diff --git a/plugins/Scriver/res/resource.rc b/plugins/Scriver/res/resource.rc index eaff37e35c..6ccda73dc8 100644 --- a/plugins/Scriver/res/resource.rc +++ b/plugins/Scriver/res/resource.rc @@ -45,8 +45,6 @@ BEGIN CONTROL "Remember unsent messages",IDC_SAVEDRAFTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,103,293,10 CONTROL "Delete temporary contacts on closing",IDC_DELTEMP, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,114,293,10 - CONTROL "Allow BBCode formatting in outgoing messages",IDC_SEND_FORMAT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,126,293,10 LTEXT "Show warning when message has not been received after",IDC_STATIC,6,145,201,8 EDITTEXT IDC_SECONDS,213,143,35,12,ES_RIGHT | ES_NUMBER CONTROL "",IDC_SECONDSSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,239,143,11,13 diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 3778b66d69..e5ff6b545a 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -92,7 +92,6 @@ CMsgDialog::CMsgDialog(MCONTACT hContact, bool bIncoming) : SetParent(GetParentWindow(m_hContact, isChat())); m_pParent = (ParentWindowData *)GetWindowLongPtr(m_hwndParent, GWLP_USERDATA); - m_bSendFormat = g_plugin.bSendFormat; m_btnOk.OnClick = Callback(this, &CMsgDialog::onClick_Ok); timerType.OnEvent = Callback(this, &CMsgDialog::onType); diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 473929fa5d..7e6dddeccb 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -243,7 +243,7 @@ class CMainOptionsDlg : public CBaseOptionDlg CCtrlSpin spinTimeout; CCtrlCheck chkAutoMin, chkAutoPopup, chkCascade, chkSavePerContact, chkStayMinimized; - CCtrlCheck chkSaveDrafts, chkDelTemp, chkHideContainer, chkSendFormat; + CCtrlCheck chkSaveDrafts, chkDelTemp, chkHideContainer; CCtrlTreeView m_tree; public: @@ -255,7 +255,6 @@ public: chkCascade(this, IDC_CASCADE), chkDelTemp(this, IDC_DELTEMP), chkAutoPopup(this, IDC_AUTOPOPUP), - chkSendFormat(this, IDC_SEND_FORMAT), chkSaveDrafts(this, IDC_SAVEDRAFTS), chkHideContainer(this, IDC_HIDECONTAINERS), chkStayMinimized(this, IDC_STAYMINIMIZED), @@ -265,7 +264,6 @@ public: CreateLink(chkCascade, g_plugin.bCascade); CreateLink(chkAutoMin, g_plugin.bAutoMin); CreateLink(chkAutoPopup, g_plugin.bAutoPopup); - CreateLink(chkSendFormat, g_plugin.bSendFormat); CreateLink(chkSaveDrafts, g_plugin.bSaveDrafts); CreateLink(chkHideContainer, g_plugin.bHideContainer); CreateLink(chkStayMinimized, g_plugin.bStayMinimized); diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h index 7b8c990c7f..70a16de120 100644 --- a/plugins/Scriver/src/resource.h +++ b/plugins/Scriver/src/resource.h @@ -128,7 +128,6 @@ #define IDC_NOTIFYBALLOON 1608 #define IDC_DELTEMP 1609 #define IDC_DELTEMP2 1610 -#define IDC_SEND_FORMAT 1610 #define IDC_AVATARSUPPORT 1611 #define IDC_LIMITNAMES 1615 #define IDC_TRANSPARENCY 1616 diff --git a/plugins/Scriver/src/srmm.cpp b/plugins/Scriver/src/srmm.cpp index 268a3bda76..242673aefa 100644 --- a/plugins/Scriver/src/srmm.cpp +++ b/plugins/Scriver/src/srmm.cpp @@ -56,7 +56,6 @@ CMPlugin::CMPlugin() : bAutoClose(SRMM_MODULE, "AutoClose", false), bAutoPopup(SRMM_MODULE, "AutoPopupMsg", false), bSaveDrafts(SRMM_MODULE, "SaveDrafts", false), - bSendFormat(SRMM_MODULE, "SendFormat", false), bTypingUnknown(SRMM_MODULE, "UnknownTyping", false), bHideContainer(SRMM_MODULE, "HideContainers", false), bStayMinimized(SRMM_MODULE, "StayMinimized", false), diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h index 15de6bab32..731e44ad23 100644 --- a/plugins/Scriver/src/stdafx.h +++ b/plugins/Scriver/src/stdafx.h @@ -76,7 +76,7 @@ struct CMPlugin : public PLUGIN CMOption bUseTransparency, bTopmost, bAutoClose, bTypingNew, bTypingUnknown; CMOption bShowTitleBar, bShowStatusBar, bShowToolBar, bShowInfoBar; CMOption bShowAvatar, bShowProgress, bShowIcons, bShowTime, bShowSeconds, bShowDate, bLongDate, bRelativeDate; - CMOption bGroupMessages, bMarkFollowups, bMsgOnNewline, bDrawLines, bHideNames, bIndentText, bSendFormat; + CMOption bGroupMessages, bMarkFollowups, bMsgOnNewline, bDrawLines, bHideNames, bIndentText; CMOption bUseTabs, bLimitTabs, bLimitChatTabs, bLimitNames, bSeparateChats, bTabCloseButton, bHideOneTab, bTabsAtBottom, bSwitchToActive; CMOption bShowTyping, bShowTypingWin, bShowTypingTray, bShowTypingClist, bShowTypingSwitch; CMOption iFlashCount, iHistoryMode; 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 @@ -970,15 +970,6 @@ LRESULT CMsgDialog::GetSendButtonState() return m_btnOk.SendMsg(BUTTONGETSTATEID, TRUE, 0); } -///////////////////////////////////////////////////////////////////////////////////////// -// 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 // window settings CMOption bAutoMin, bAutoClose, bFlashOnClist, bDeleteTemp; - CMOption bPasteAndSend, bSendFormat, bAutoSplit, bUseSameSplitSize, bAutoCopy; + CMOption bPasteAndSend, bAutoSplit, bUseSameSplitSize, bAutoCopy; CMOption bStatusOnTabs, bUseXStatus, bDetailedTooltips, bAllowOfflineMultisend; CMOption 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), -- cgit v1.2.3