summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-03 16:38:41 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-03 16:38:41 +0300
commit8fdc4e2ef0de78cd447d156a4f45c4eb5e372978 (patch)
treeb378b25bc69fda749a820c464f316fa5fbcb12cc
parent409484903558dfc9f7a6f8c8ead2fe47ff2f2dcf (diff)
tabSRMM: why text is restored only for private chats?
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index c0acfbd068..10ddae9188 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -595,25 +595,6 @@ bool CMsgDialog::OnInitDialog()
DM_OptionsApplied();
- // restore saved msg if any...
- ptrW wszSavedMsg(g_plugin.getWStringA(m_hContact, "SavedMsg"));
- if (wszSavedMsg != 0) {
- SETTEXTEX stx = { ST_DEFAULT, 1200 };
- m_message.SendMsg(EM_SETTEXTEX, (WPARAM)&stx, wszSavedMsg);
- UpdateSaveAndSendButton();
- if (m_pContainer->m_hwndActive == m_hwnd)
- UpdateReadChars();
- }
-
- if (wszInitialText) {
- m_message.SetText(wszInitialText);
- int len = GetWindowTextLength(m_message.GetHwnd());
- PostMessage(m_message.GetHwnd(), EM_SETSEL, len, len);
- if (len)
- EnableSendButton(true);
- mir_free(wszInitialText);
- }
-
for (MEVENT hdbEvent = db_event_last(m_hContact); hdbEvent; hdbEvent = db_event_prev(m_hContact, hdbEvent)) {
DBEVENTINFO dbei = {};
db_event_get(hdbEvent, &dbei);
@@ -625,6 +606,25 @@ bool CMsgDialog::OnInitDialog()
}
}
+ // restore saved msg if any...
+ ptrW wszSavedMsg(g_plugin.getWStringA(m_hContact, "SavedMsg"));
+ if (wszSavedMsg != 0) {
+ SETTEXTEX stx = { ST_DEFAULT, 1200 };
+ m_message.SendMsg(EM_SETTEXTEX, (WPARAM)&stx, wszSavedMsg);
+ UpdateSaveAndSendButton();
+ if (m_pContainer->m_hwndActive == m_hwnd)
+ UpdateReadChars();
+ }
+
+ if (wszInitialText) {
+ m_message.SetText(wszInitialText);
+ int len = GetWindowTextLength(m_message.GetHwnd());
+ PostMessage(m_message.GetHwnd(), EM_SETSEL, len, len);
+ if (len)
+ EnableSendButton(true);
+ mir_free(wszInitialText);
+ }
+
SendMessage(m_pContainer->m_hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
SetWindowPos(m_hwnd, nullptr, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), m_bActivate ? 0 : SWP_NOZORDER | SWP_NOACTIVATE);