diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-06-15 01:01:29 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-06-15 01:01:29 -0400 |
commit | d527669d39d96e40b6dabfc0a687d1a20faa23da (patch) | |
tree | 11b8bc58c4c5daf79d169dc64bdccbe97b37f1b9 /components | |
parent | e166c83d33bbf5aebe172111c8a7614c1dece48c (diff) | |
download | abaddon-portaudio-d527669d39d96e40b6dabfc0a687d1a20faa23da.tar.gz abaddon-portaudio-d527669d39d96e40b6dabfc0a687d1a20faa23da.zip |
pins: separate msgs, sort and store
Diffstat (limited to 'components')
-rw-r--r-- | components/chatlist.cpp | 6 | ||||
-rw-r--r-- | components/chatlist.hpp | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/components/chatlist.cpp b/components/chatlist.cpp index d9e0f89..d927cc8 100644 --- a/components/chatlist.cpp +++ b/components/chatlist.cpp @@ -61,7 +61,7 @@ void ChatList::ProcessNewMessage(const Message &data, bool prepend) { ChatMessageHeader *last_row = nullptr; bool should_attach = false; - if (m_num_rows > 0) { + if (!m_separate_all && m_num_rows > 0) { if (prepend) last_row = dynamic_cast<ChatMessageHeader *>(m_list.get_row_at_index(0)); else @@ -210,6 +210,10 @@ std::vector<Snowflake> ChatList::GetRecentAuthors() { return ret; } +void ChatList::SetSeparateAll(bool separate) { + m_separate_all = true; +} + void ChatList::OnScrollEdgeOvershot(Gtk::PositionType pos) { if (pos == Gtk::POS_TOP) m_signal_action_chat_load_history.emit(m_active_channel); diff --git a/components/chatlist.hpp b/components/chatlist.hpp index 0726cf5..71ee4ed 100644 --- a/components/chatlist.hpp +++ b/components/chatlist.hpp @@ -20,6 +20,7 @@ public: void UpdateMessageReactions(Snowflake id); void SetFailedByNonce(const std::string &nonce); std::vector<Snowflake> GetRecentAuthors(); + void SetSeparateAll(bool separate); private: void OnScrollEdgeOvershot(Gtk::PositionType pos); @@ -35,6 +36,8 @@ private: bool m_should_scroll_to_bottom = true; Gtk::ListBox m_list; + bool m_separate_all = false; + public: // these are all forwarded by the parent using type_signal_action_message_delete = sigc::signal<void, Snowflake, Snowflake>; |