summaryrefslogtreecommitdiff
path: root/components/chatwindow.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-09-14 00:17:58 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2020-09-14 00:17:58 -0400
commite5a90b94618bafc6bc99afbbff37f7aa3d6a97cf (patch)
tree28e9dd46f0a423252133ff3b21e508f37e348d55 /components/chatwindow.cpp
parent2822add5fe791a120c160e188cecac7ce29d9961 (diff)
downloadabaddon-portaudio-e5a90b94618bafc6bc99afbbff37f7aa3d6a97cf.tar.gz
abaddon-portaudio-e5a90b94618bafc6bc99afbbff37f7aa3d6a97cf.zip
only load 50 messages on channel switch (also fix member menu)
Diffstat (limited to 'components/chatwindow.cpp')
-rw-r--r--components/chatwindow.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/components/chatwindow.cpp b/components/chatwindow.cpp
index b7da92d..652844a 100644
--- a/components/chatwindow.cpp
+++ b/components/chatwindow.cpp
@@ -237,6 +237,17 @@ void ChatWindow::InsertChatInput(std::string text) {
m_input->grab_focus();
}
+Snowflake ChatWindow::GetOldestListedMessage() {
+ Snowflake m;
+
+ for (const auto& [id, widget] : m_id_to_widget) {
+ if (id < m)
+ m = id;
+ }
+
+ return m;
+}
+
void ChatWindow::ScrollToBottom() {
auto x = m_scroll->get_vadjustment();
x->set_value(x->get_upper());