summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-10-03 20:11:54 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-10-03 20:11:54 +0300
commit2859081c36402ea7fcbbe4e52799b62e7537ffbf (patch)
tree0c14b8e958225ee94d3d3433c64e61c7ce04d6bc /plugins
parent20760db2aec15c20b4fd8a9db7f4112f8c0cf6ce (diff)
fixes #1607 (Scriver silently cuts long messages)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Scriver/src/msgdialog.cpp2
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp18
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp16
-rw-r--r--plugins/TabSRMM/src/msgs.h1
4 files changed, 18 insertions, 19 deletions
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 96bf1e24fc..4b11aea221 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -266,7 +266,7 @@ bool CSrmmWindow::OnInitDialog()
if (m_hContact && m_szProto) {
int nMax = CallProtoService(m_szProto, PS_GETCAPS, PFLAG_MAXLENOFMESSAGE, m_hContact);
if (nMax)
- m_message.SendMsg(EM_LIMITTEXT, nMax, 0);
+ m_message.SendMsg(EM_EXLIMITTEXT, 0, nMax);
}
// get around a lame bug in the Windows template resource code where richedits are limited to 0x7FFF
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index ce3e1c94b7..89eece1cb7 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -545,20 +545,12 @@ size_t CContactCache::getMaxMessageLength()
if (szProto) {
m_nMax = CallProtoService(szProto, PS_GETCAPS, PFLAG_MAXLENOFMESSAGE, hContact);
if (m_nMax) {
- if (M.GetByte("autosplit", 0)) {
- if (m_dat)
- ::SendDlgItemMessage(m_dat->GetHwnd(), IDC_SRMM_MESSAGE, EM_EXLIMITTEXT, 0, 20000);
- }
- else {
- if (m_dat)
- ::SendDlgItemMessage(m_dat->GetHwnd(), IDC_SRMM_MESSAGE, EM_EXLIMITTEXT, 0, (LPARAM)m_nMax);
- }
- }
- else {
- if (m_dat)
- ::SendDlgItemMessage(m_dat->GetHwnd(), IDC_SRMM_MESSAGE, EM_EXLIMITTEXT, 0, 20000);
- m_nMax = 20000;
+ if (M.GetByte("autosplit", 0))
+ m_dat->LimitMessageText(20000);
+ else
+ m_dat->LimitMessageText(m_nMax);
}
+ else m_dat->LimitMessageText(m_nMax = 20000);
}
return m_nMax;
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 168ed1334f..7de395df5e 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -1639,11 +1639,6 @@ void CTabBaseDlg::DetermineMinHeight()
m_pContainer->uChildMinHeight = height;
}
-bool CTabBaseDlg::IsAutoSplitEnabled() const
-{
- return (m_pContainer->dwFlags & CNT_AUTOSPLITTER) && !(m_dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE);
-}
-
LONG CTabBaseDlg::GetDefaultMinimumInputHeight() const
{
LONG height = (m_pContainer->dwFlags & CNT_BOTTOMTOOLBAR) ? DPISCALEY_S(46 + 22) : DPISCALEY_S(46);
@@ -1654,6 +1649,17 @@ LONG CTabBaseDlg::GetDefaultMinimumInputHeight() const
return height;
}
+bool CTabBaseDlg::IsAutoSplitEnabled() const
+{
+ return (m_pContainer->dwFlags & CNT_AUTOSPLITTER) && !(m_dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE);
+}
+
+void CTabBaseDlg::LimitMessageText(int iLen)
+{
+ if (this != nullptr)
+ m_message.SendMsg(EM_EXLIMITTEXT, 0, iLen);
+}
+
static LIST<wchar_t> vTempFilenames(5);
// send a pasted bitmap by file transfer.
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index e209122ef5..72bfdc0eb4 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -438,6 +438,7 @@ public:
void HandlePasteAndSend();
HICON IconFromAvatar() const;
void KbdState(bool &isShift, bool &isControl, bool &isAlt);
+ void LimitMessageText(int iLen);
int LoadLocalFlags();
void LoadSplitter();
int MustPlaySound() const;