Send federated reports to all community mods (#5342)

This commit is contained in:
Nutomic 2025-01-22 20:47:07 +00:00 committed by GitHub
parent 72b74679aa
commit 1fdc229338
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,