feat(dashboard): pending guild names count on the Review Queue and Guilds badges

The dashboard snapshot counts guilds whose name waits for moderation; the moderation counts (WebSocket and
/api/moderation/counts) include it, the Review Queue badge adds it for staff with guilds_manage, and the Guilds menu
entry has its own badge. Check: create a guild with a name off the allow list: both badges go up; approve it: they
go down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 08:46:34 -05:00
parent 24d96f13df
commit 33402425e4
7 changed files with 10 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ namespace {
"(SELECT COUNT(*) FROM bug_reports WHERE resolved_time IS NULL) AS unresolved_bug_reports, "
"(SELECT COUNT(*) FROM pet_names) AS pet_names, "
"(SELECT COUNT(*) FROM pet_names WHERE approved = 1) AS pending_pet_names, "
"(SELECT COUNT(*) FROM guilds WHERE name_status = 1) AS pending_guild_names, "
"(SELECT COALESCE(MAX(id), 0) FROM activity_log) AS activity_log_max_id, "
"(SELECT COALESCE(MAX(id), 0) FROM chat_log) AS chat_log_max_id, "
"(SELECT COALESCE(MAX(id), 0) FROM command_log) AS command_log_max_id, "
@@ -255,6 +256,7 @@ IDashboardStats::Snapshot MySQLDatabase::GetDashboardSnapshot() {
snapshot.unresolvedBugReports = result->getUInt64("unresolved_bug_reports");
snapshot.petNames = result->getUInt64("pet_names");
snapshot.pendingPetNames = result->getUInt64("pending_pet_names");
snapshot.pendingGuildNames = result->getUInt64("pending_guild_names");
snapshot.activityLogMaxId = result->getUInt64("activity_log_max_id");
snapshot.chatLogMaxId = result->getUInt64("chat_log_max_id");
snapshot.commandLogMaxId = result->getUInt64("command_log_max_id");