summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-01-09 02:10:48 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2021-01-09 02:10:48 -0500
commit4d62944dbb0fe2a803f94e05bddc67ef7c8947fe (patch)
tree48712a042f17cbb35116818b76bb1aab29d7366a /components
parent117e5db5646ef74e7f09864d8450bac792e14923 (diff)
downloadabaddon-portaudio-4d62944dbb0fe2a803f94e05bddc67ef7c8947fe.tar.gz
abaddon-portaudio-4d62944dbb0fe2a803f94e05bddc67ef7c8947fe.zip
fix channel/guild updates
Diffstat (limited to 'components')
-rw-r--r--components/channels.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/components/channels.cpp b/components/channels.cpp
index fc82795..e9b85f9 100644
--- a/components/channels.cpp
+++ b/components/channels.cpp
@@ -433,12 +433,11 @@ void ChannelList::UpdateChannel(Snowflake id) {
auto *new_row = Gtk::manage(new ChannelListRowChannel(&*data));
new_row->IsUserCollapsed = old_collapsed;
m_id_to_row[id] = new_row;
- if (data->ParentID->IsValid()) {
+ if (data->ParentID.has_value()) {
new_row->Parent = m_id_to_row.at(*data->ParentID);
} else {
new_row->Parent = m_guild_id_to_row.at(*data->GuildID);
}
-
new_row->Parent->Children.insert(new_row);
if (new_row->Parent->is_visible() && !new_row->Parent->IsUserCollapsed)
new_row->show();
@@ -599,7 +598,7 @@ void ChannelList::InsertGuildAt(Snowflake id, int pos) {
if (!channel.has_value()) continue;
if (channel->Type != ChannelType::GUILD_TEXT && channel->Type != ChannelType::GUILD_NEWS) continue;
- if (channel->ParentID->IsValid())
+ if (channel->ParentID.has_value())
cat_to_channels[*channel->ParentID].push_back(*channel);
else
orphan_channels[*channel->Position] = *channel;