diff options
author | George Hazan <ghazan@miranda.im> | 2019-10-03 20:12:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-10-03 20:12:17 +0300 |
commit | 1c79bb4a2bc81b9a726ebcbb9993a0fada886f47 (patch) | |
tree | 9a727482e8b11e2457ab5e4cfdac2e2b9d82638e /plugins/TabSRMM | |
parent | 7a81e01aeec30c64bd4b5487fe876b5ed019b532 (diff) |
fixes #2089 (tabSRMM doesn't scroll to bottom if custom log is chosen)
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgother.cpp | 17 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.h | 1 |
5 files changed, 18 insertions, 12 deletions
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index d7087b5911..196a37e7a8 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1136,7 +1136,7 @@ void CMsgDialog::DM_EventAdded(WPARAM hContact, LPARAM lParam) if (hDbEvent != m_hDbEventFirst) { if (!(m_dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED)) - m_pLog->LogEvents(hDbEvent, 1, 1); + StreamEvents(hDbEvent, 1, 1); else { if (m_iNextQueuedEvent >= m_iEventQueueSize) { m_hQueuedEvents = (MEVENT*)mir_realloc(m_hQueuedEvents, (m_iEventQueueSize + 10) * sizeof(MEVENT)); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 6a6867b2d4..8100da457e 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2741,7 +2741,7 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) RemakeLog();
}
else if (m_hContact == wParam && db_mc_isSub(wParam) && db_event_getContact(lParam) != wParam)
- m_pLog->LogEvents(lParam, 1, 1);
+ StreamEvents(lParam, 1, 1);
return 0;
case HM_DBEVENTADDED:
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index e6ebb9eb48..a21f3f99a0 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -1219,7 +1219,7 @@ void CMsgDialog::RemakeLog() m_szMicroLf[0] = 0; m_lastEventTime = 0; m_iLastEventType = -1; - m_pLog->LogEvents(m_hDbEventFirst, -1, 0); + StreamEvents(m_hDbEventFirst, -1, 0); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -1228,7 +1228,7 @@ void CMsgDialog::ReplayQueue() { for (int i = 0; i < m_iNextQueuedEvent; i++) if (m_hQueuedEvents[i] != 0) - m_pLog->LogEvents(m_hQueuedEvents[i], 1, 1); + StreamEvents(m_hQueuedEvents[i], 1, 1); m_iNextQueuedEvent = 0; SetDlgItemText(m_hwnd, IDC_LOGFROZENTEXT, m_bNotOnList ? TranslateT("Contact not on list. You may add it...") : @@ -1696,6 +1696,19 @@ void CMsgDialog::SplitterMoved(int coord, HWND hwnd) ///////////////////////////////////////////////////////////////////////////////////////// +void CMsgDialog::StreamEvents(MEVENT hDbEventFirst, int count, bool bAppend) +{ + m_pLog->LogEvents(hDbEventFirst, count, bAppend); + + DM_ScrollToBottom(0, 0); + if (bAppend && hDbEventFirst) + m_hDbEventLast = hDbEventFirst; + else + m_hDbEventLast = db_event_last(m_hContact); +} + +///////////////////////////////////////////////////////////////////////////////////////// + bool CMsgDialog::TabAutoComplete() { LRESULT lResult = m_message.SendMsg(EM_GETSEL, 0, 0); diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index faf830e942..c358875db2 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -1223,12 +1223,6 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool fAppend, DBEVEN tm_today.tm_hour = tm_today.tm_min = tm_today.tm_sec = 0;
today = mktime(&tm_today);
- m_pDlg.DM_ScrollToBottom(0, 0);
- if (fAppend && hDbEventFirst)
- m_pDlg.m_hDbEventLast = hDbEventFirst;
- else
- m_pDlg.m_hDbEventLast = db_event_last(m_pDlg.m_hContact);
-
// separator strings used for grid lines, message separation and so on...
m_pDlg.m_bClrAdded = false;
@@ -1316,8 +1310,6 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool fAppend, DBEVEN int len = GetWindowTextLength(m_rtf.GetHwnd())-1;
m_rtf.SendMsg(EM_SETSEL, len, len);
- m_pDlg.DM_ScrollToBottom(0, 0);
-
m_rtf.SendMsg(WM_SETREDRAW, TRUE, 0);
InvalidateRect(m_rtf.GetHwnd(), nullptr, FALSE);
EnableWindow(GetDlgItem(m_pDlg.m_hwnd, IDC_QUOTE), m_pDlg.m_hDbEventLast != 0);
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 818ec6606b..029307088c 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -344,6 +344,7 @@ class CMsgDialog : public CSrmmBaseDialog void SaveAvatarToFile(HBITMAP hbm, int isOwnPic);
void SendHBitmapAsFile(HBITMAP hbmp) const;
void ShowPopupMenu(const CCtrlBase&, POINT pt);
+ void StreamEvents(MEVENT, int, bool);
void UpdateWindowIcon(void);
void UpdateWindowState(UINT msg);
void VerifyProxy(void);
|