creator,
vec![to],
context.pool(),
+ true,
)
.await?;
}
community,
to,
context.pool(),
+ true,
)
.await?;
creator,
vec![inbox],
context.pool(),
+ true,
)
.await?;
}
creator,
mentions,
context.pool(),
+ false, // Don't create a new DB row
)
.await?;
Ok(())
actor: &dyn ActorType,
to: Vec<Url>,
pool: &DbPool,
+ insert_into_db: bool,
) -> Result<(), LemmyError>
where
T: AsObject<Kind> + Extends<Kind>,
let activity = activity.into_any_base()?;
let serialised_activity = serde_json::to_string(&activity)?;
- insert_activity(actor.user_id(), activity.clone(), true, pool).await?;
+
+ // This is necessary because send_comment and send_comment_mentions
+ // might send the same ap_id
+ if insert_into_db {
+ insert_activity(actor.user_id(), activity.clone(), true, pool).await?;
+ }
// TODO: it would make sense to create a separate task for each destination server
let message = SendActivityTask {