From 1fdc22933815b779e6708c06c2e2958f529194f8 Mon Sep 17 00:00:00 2001 From: Nutomic Date: Wed, 22 Jan 2025 20:47:07 +0000 Subject: [PATCH] Send federated reports to all community mods (#5342) --- crates/apub/src/activities/community/report.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/apub/src/activities/community/report.rs b/crates/apub/src/activities/community/report.rs index 804822d6e..50ee60183 100644 --- a/crates/apub/src/activities/community/report.rs +++ b/crates/apub/src/activities/community/report.rs @@ -29,6 +29,7 @@ use lemmy_db_schema::{ }, traits::{Crud, Reportable}, }; +use lemmy_db_views_actor::structs::CommunityModeratorView; use lemmy_utils::error::{LemmyError, LemmyResult}; use url::Url; @@ -61,6 +62,13 @@ impl Report { // send report to the community where object was posted let mut inboxes = ActivitySendTargets::to_inbox(community.shared_inbox_or_inbox()); + // send to all moderators + let moderators = + CommunityModeratorView::for_community(&mut context.pool(), community.id).await?; + for m in moderators { + inboxes.add_inbox(m.moderator.actor_id.into()); + } + // also send report to user's home instance if possible let object_creator_id = match object_id.dereference_local(&context).await? { PostOrComment::Post(p) => p.creator_id,