From 0479bf52c2417cd983d808b6bce3f48f1551d6d9 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 3 Feb 2021 22:12:35 -0500 Subject: show MESSAGE_BULK_DELETE in audit log and show items with no extra markup as expanded --- windows/guildsettings/auditlogpane.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'windows/guildsettings/auditlogpane.cpp') diff --git a/windows/guildsettings/auditlogpane.cpp b/windows/guildsettings/auditlogpane.cpp index 5776e27..7f789e7 100644 --- a/windows/guildsettings/auditlogpane.cpp +++ b/windows/guildsettings/auditlogpane.cpp @@ -421,6 +421,22 @@ void GuildSettingsAuditLogPane::OnAuditLogFetch(const AuditLogData &data) { "deleted " + count + " messages"; } } break; + case AuditLogActionType::MESSAGE_BULK_DELETE: { + const auto channel = discord.GetChannel(entry.TargetID); + if (channel.has_value()) { + markup = "" + user.GetEscapedString() + " " + + "deleted " + + *entry.Options->Count + + " messages in #" + + Glib::Markup::escape_text(*channel->Name) + + ""; + } else { + markup = "" + user.GetEscapedString() + " " + + "deleted " + + *entry.Options->Count + + " messages"; + } + } break; case AuditLogActionType::MESSAGE_PIN: { const auto target_user = discord.GetUser(entry.TargetID); markup = "" + user.GetEscapedString() + " " + @@ -449,7 +465,7 @@ void GuildSettingsAuditLogPane::OnAuditLogFetch(const AuditLogData &data) { ""); } - if (extra_markup.size() == 1) + if (extra_markup.size() <= 1) expander->set_expanded(true); auto contents = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); -- cgit v1.2.3