mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-06 20:15:19 +03:00
handle CHANNEL_FOLLOW_ADD messages
This commit is contained in:
@@ -60,7 +60,7 @@ ChatMessageItemContainer *ChatMessageItemContainer::FromMessage(Snowflake id) {
|
||||
container->m_main->add(*container->m_text_component);
|
||||
}
|
||||
|
||||
if (data->MessageReference.has_value() || data->Interaction.has_value()) {
|
||||
if ((data->MessageReference.has_value() || data->Interaction.has_value()) && data->Type != MessageType::CHANNEL_FOLLOW_ADD) {
|
||||
auto *widget = container->CreateReplyComponent(*data);
|
||||
container->m_main->add(*widget);
|
||||
container->m_main->child_property_position(*widget) = 0; // eek
|
||||
@@ -270,6 +270,10 @@ void ChatMessageItemContainer::UpdateTextComponent(Gtk::TextView *tv) {
|
||||
b->insert_markup(s, "<i><span color='#999999'>" + author->GetEscapedBoldName() + " just boosted the server <b>" + Glib::Markup::escape_text(data->Content) + "</b> times! " +
|
||||
Glib::Markup::escape_text(guild->Name) + " has achieved <b>Level " + std::to_string(static_cast<int>(data->Type) - 8) + "!</b></span></i>"); // oo cheeky me !!!
|
||||
} break;
|
||||
case MessageType::CHANNEL_FOLLOW_ADD: {
|
||||
const auto author = Abaddon::Get().GetDiscordClient().GetUser(data->Author.ID);
|
||||
b->insert_markup(s, "<i><span color='#999999'>" + author->GetEscapedBoldName() + " has added <b>" + Glib::Markup::escape_text(data->Content) + "</b> to this channel. Its most important updates will show up here.</span></i>");
|
||||
} break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ enum class MessageType {
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 = 9, // yep
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2 = 10, // yep
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 = 11, // yep
|
||||
CHANNEL_FOLLOW_ADD = 12, // nope
|
||||
CHANNEL_FOLLOW_ADD = 12, // yep
|
||||
GUILD_DISCOVERY_DISQUALIFIED = 14, // nope
|
||||
GUILD_DISCOVERY_REQUALIFIED = 15, // nope
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING = 16, // nope
|
||||
|
||||
Reference in New Issue
Block a user