only load 50 messages on channel switch (also fix member menu)

This commit is contained in:
ouwou
2020-09-14 00:17:58 -04:00
parent 2822add5fe
commit e5a90b9461
8 changed files with 46 additions and 2 deletions

View File

@@ -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());