mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-06 20:15:19 +03:00
show news channels
This commit is contained in:
@@ -264,7 +264,7 @@ void Abaddon::ActionChannelOpened(Snowflake id) {
|
||||
if (channel->Type != ChannelType::DM && channel->Type != ChannelType::GROUP_DM)
|
||||
m_discord.SendLazyLoad(id);
|
||||
|
||||
if (channel->Type == ChannelType::GUILD_TEXT)
|
||||
if (channel->Type == ChannelType::GUILD_TEXT || channel->Type == ChannelType::GUILD_NEWS)
|
||||
m_main_window->set_title(std::string(APP_TITLE) + " - #" + channel->Name);
|
||||
else {
|
||||
std::string display;
|
||||
|
||||
@@ -369,7 +369,7 @@ void ChannelList::UpdateCreateChannel(Snowflake id) {
|
||||
}
|
||||
|
||||
ChannelListRow *row;
|
||||
if (data->Type == ChannelType::GUILD_TEXT) {
|
||||
if (data->Type == ChannelType::GUILD_TEXT || data->Type == ChannelType::GUILD_NEWS) {
|
||||
row = Gtk::manage(new ChannelListRowChannel(data));
|
||||
} else if (data->Type == ChannelType::GUILD_CATEGORY) {
|
||||
row = Gtk::manage(new ChannelListRowCategory(data));
|
||||
@@ -478,7 +478,7 @@ void ChannelList::InsertGuildAt(Snowflake id, int pos) {
|
||||
std::map<int, const Channel *> orphan_channels;
|
||||
std::unordered_map<Snowflake, std::vector<const Channel *>> cat_to_channels;
|
||||
for (const auto &channel : guild_data->Channels) {
|
||||
if (channel.Type != ChannelType::GUILD_TEXT) continue;
|
||||
if (channel.Type != ChannelType::GUILD_TEXT && channel.Type != ChannelType::GUILD_NEWS) continue;
|
||||
|
||||
if (channel.ParentID.IsValid())
|
||||
cat_to_channels[channel.ParentID].push_back(&channel);
|
||||
|
||||
@@ -134,9 +134,9 @@ std::vector<Snowflake> Guild::GetSortedChannels(Snowflake ignore) const {
|
||||
for (const auto &channel_id : channels) {
|
||||
const auto *data = discord.GetChannel(channel_id);
|
||||
if (data == nullptr) continue;
|
||||
if (!data->ParentID.IsValid() && data->Type == ChannelType::GUILD_TEXT)
|
||||
if (!data->ParentID.IsValid() && (data->Type == ChannelType::GUILD_TEXT || data->Type == ChannelType::GUILD_NEWS))
|
||||
orphan_channels[data->Position].push_back(data);
|
||||
else if (data->ParentID.IsValid() && data->Type == ChannelType::GUILD_TEXT)
|
||||
else if (data->ParentID.IsValid() && (data->Type == ChannelType::GUILD_TEXT || data->Type == ChannelType::GUILD_NEWS))
|
||||
category_to_channels[data->ParentID].push_back(data);
|
||||
else if (data->Type == ChannelType::GUILD_CATEGORY)
|
||||
position_to_categories[data->Position].push_back(data);
|
||||
|
||||
Reference in New Issue
Block a user