};
use lemmy_utils::LemmyError;
use lemmy_websocket::LemmyContext;
-use tracing::info;
#[async_trait::async_trait(?Send)]
pub(crate) trait GetCommunity {
context: &LemmyContext,
) -> Result<(), LemmyError> {
let announce = AnnounceActivity::new(object.clone(), community, context)?;
- // temporary hack to get activity id of object
- let object_fields: ActivityCommonFields =
- serde_json::from_value(serde_json::to_value(&object)?)?;
- info!(
- "Announcing activity {} as {}",
- object_fields.id, announce.id
- );
-
let inboxes = community.get_follower_inboxes(context).await?;
send_lemmy_activity(
context,
};
use lemmy_utils::LemmyError;
use lemmy_websocket::{send::send_comment_ws_message, LemmyContext, UserOperationCrud};
-use tracing::info;
impl CreateOrUpdateComment {
#[tracing::instrument(skip(comment, actor, kind, context))]
kind.clone(),
&context.settings().get_protocol_and_hostname(),
)?;
- info!("Sending Create/Comment for {} as {}", comment.ap_id, id);
let note = comment.into_apub(context).await?;
let create_or_update = CreateOrUpdateComment {
objects::{community::ApubCommunity, person::ApubPerson},
};
use activitystreams_kinds::public;
-use itertools::Itertools;
use lemmy_api_common::blocking;
use lemmy_apub_lib::{
activity_queue::send_activity,
}
let activity = WithContext::new(activity);
+ info!("Sending activity {}", activity_id.to_string());
+
// Don't send anything to ourselves
// TODO: this should be a debug assert
let hostname = context.settings().get_hostname_without_port()?;
.filter(|i| i.domain().expect("valid inbox url") != hostname)
.collect();
- info!(
- "Sending activity {} to [{}]",
- activity_id.to_string(),
- inboxes.iter().join(",")
- );
-
let serialised_activity = serde_json::to_string(&activity)?;
let object_value = serde_json::to_value(&activity)?;