2 activities::send_lemmy_activity,
3 activity_lists::AnnouncableActivities,
4 objects::community::ApubCommunity,
5 protocol::activities::community::announce::AnnounceActivity,
7 use lemmy_apub_lib::{object_id::ObjectId, traits::ActorType};
8 use lemmy_utils::LemmyError;
9 use lemmy_websocket::LemmyContext;
17 pub mod undo_block_user;
20 pub(crate) async fn send_activity_in_community<T: ActorType>(
21 activity: AnnouncableActivities,
24 community: &ApubCommunity,
25 mut inboxes: Vec<Url>,
26 context: &LemmyContext,
27 ) -> Result<(), LemmyError> {
28 inboxes.push(community.shared_inbox_or_inbox_url());
29 send_lemmy_activity(context, &activity, activity_id, actor, inboxes, false).await?;
32 AnnounceActivity::send(activity, community, context).await?;
38 async fn get_community_from_moderators_url(
40 context: &LemmyContext,
41 request_counter: &mut i32,
42 ) -> Result<ApubCommunity, LemmyError> {
43 let community_id = Url::parse(&moderators.to_string().replace("/moderators", ""))?;
44 ObjectId::new(community_id)
45 .dereference(context, request_counter)