mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-01-23 18:35:56 +00:00
Send federated reports to all community mods (#5342)
This commit is contained in:
parent
72b74679aa
commit
1fdc229338
1 changed files with 8 additions and 0 deletions
|
@ -29,6 +29,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::{Crud, Reportable},
|
traits::{Crud, Reportable},
|
||||||
};
|
};
|
||||||
|
use lemmy_db_views_actor::structs::CommunityModeratorView;
|
||||||
use lemmy_utils::error::{LemmyError, LemmyResult};
|
use lemmy_utils::error::{LemmyError, LemmyResult};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
@ -61,6 +62,13 @@ impl Report {
|
||||||
// send report to the community where object was posted
|
// send report to the community where object was posted
|
||||||
let mut inboxes = ActivitySendTargets::to_inbox(community.shared_inbox_or_inbox());
|
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
|
// also send report to user's home instance if possible
|
||||||
let object_creator_id = match object_id.dereference_local(&context).await? {
|
let object_creator_id = match object_id.dereference_local(&context).await? {
|
||||||
PostOrComment::Post(p) => p.creator_id,
|
PostOrComment::Post(p) => p.creator_id,
|
||||||
|
|
Loading…
Reference in a new issue