summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/channels.cpp7
-rw-r--r--components/channels.hpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/components/channels.cpp b/components/channels.cpp
index a80cfd8..e175e8c 100644
--- a/components/channels.cpp
+++ b/components/channels.cpp
@@ -129,6 +129,7 @@ ChannelList::ChannelList()
discord.signal_channel_update().connect(sigc::mem_fun(*this, &ChannelList::UpdateChannel));
discord.signal_channel_create().connect(sigc::mem_fun(*this, &ChannelList::UpdateCreateChannel));
discord.signal_thread_create().connect(sigc::mem_fun(*this, &ChannelList::UpdateCreateThread));
+ discord.signal_thread_delete().connect(sigc::mem_fun(*this, &ChannelList::UpdateDeleteThread));
discord.signal_guild_update().connect(sigc::mem_fun(*this, &ChannelList::UpdateGuild));
}
@@ -271,6 +272,12 @@ void ChannelList::UpdateCreateThread(const ChannelData &channel) {
CreateThreadRow(parent_row->children(), channel);
}
+void ChannelList::UpdateDeleteThread(const ThreadDeleteData &data) {
+ auto iter = GetIteratorForChannelFromID(data.ID);
+ if (iter)
+ m_model->erase(iter);
+}
+
void ChannelList::SetActiveChannel(Snowflake id) {
const auto channel_iter = GetIteratorForChannelFromID(id);
if (channel_iter) {
diff --git a/components/channels.hpp b/components/channels.hpp
index bdc3e84..ed87b57 100644
--- a/components/channels.hpp
+++ b/components/channels.hpp
@@ -141,6 +141,7 @@ protected:
void UpdateChannel(Snowflake id);
void UpdateCreateChannel(const ChannelData &channel);
void UpdateCreateThread(const ChannelData &channel);
+ void UpdateDeleteThread(const ThreadDeleteData &data);
void UpdateGuild(Snowflake id);
Gtk::TreeView m_view;