diff options
author | George Hazan <ghazan@miranda.im> | 2020-04-26 20:53:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-04-26 20:53:56 +0300 |
commit | 5402e71b923712624d6df9aad6f3983ba4e44f4e (patch) | |
tree | dc8f495a395a9b01d220ab8c4677fa7cff3aac12 /plugins/NewStory/src | |
parent | f5c38382ae6c0b9c70dd8859baa68301b76474f1 (diff) |
minor code cleaning
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r-- | plugins/NewStory/src/history_log.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/NewStory/src/history_log.cpp b/plugins/NewStory/src/history_log.cpp index 269d25ea7e..d1d0f69b36 100644 --- a/plugins/NewStory/src/history_log.cpp +++ b/plugins/NewStory/src/history_log.cpp @@ -24,7 +24,9 @@ public: bool AtBottom() override { - return false; + int totalCount = SendMessage(m_hwnd, NSM_GETCOUNT, 0, 0); + int caret = SendMessage(m_hwnd, NSM_GETCARET, 0, 0); + return caret >= totalCount - 1; } void Clear() override @@ -55,8 +57,11 @@ public: SendMessage(m_hwnd, NSM_ADDEVENTS, (LPARAM)&tmp, 0); } - void LogEvents(LOGINFO *pLog, bool) override + void LogEvents(LOGINFO *pLog, bool bAppend) override { + if (!bAppend) + Clear(); + while (pLog) { SendMessage(m_hwnd, NSM_ADDCHATEVENT, (WPARAM)m_pDlg.getChat(), (LPARAM)pLog); pLog = pLog->prev; |