request_counter: &mut i32,
) -> Result<(), LemmyError> {
let comment = ApubComment::from_apub(self.object, context, request_counter).await?;
- let recipients = get_notif_recipients(&self.actor, &comment, context, request_counter).await?;
+ let do_send_email = self.kind == CreateOrUpdateType::Create;
+ let recipients = get_notif_recipients(
+ &self.actor,
+ &comment,
+ do_send_email,
+ context,
+ request_counter,
+ )
+ .await?;
let notif_type = match self.kind {
CreateOrUpdateType::Create => UserOperationCrud::CreateComment,
CreateOrUpdateType::Update => UserOperationCrud::EditComment,
async fn get_notif_recipients(
actor: &ObjectId<ApubPerson>,
comment: &Comment,
+ do_send_email: bool,
context: &LemmyContext,
request_counter: &mut i32,
) -> Result<Vec<LocalUserId>, LemmyError> {
// anyway.
// TODO: for compatibility with other projects, it would be much better to read this from cc or tags
let mentions = scrape_text_for_mentions(&comment.content);
- send_local_notifs(mentions, comment, &*actor, &post, true, context).await
+ send_local_notifs(mentions, comment, &*actor, &post, do_send_email, context).await
}