let maa = collect_non_local_mentions(&self, &community, context).await?;
- let mut create = Create::new(creator.actor_id.to_owned(), note.into_any_base()?);
+ let mut create = Create::new(
+ creator.actor_id.to_owned().into_inner(),
+ note.into_any_base()?,
+ );
create
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(CreateType::Create)?)
let maa = collect_non_local_mentions(&self, &community, context).await?;
- let mut update = Update::new(creator.actor_id.to_owned(), note.into_any_base()?);
+ let mut update = Update::new(
+ creator.actor_id.to_owned().into_inner(),
+ note.into_any_base()?,
+ );
update
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(UpdateType::Update)?)
})
.await??;
- let mut delete = Delete::new(creator.actor_id.to_owned(), Url::parse(&self.ap_id)?);
+ let mut delete = Delete::new(
+ creator.actor_id.to_owned().into_inner(),
+ self.ap_id.to_owned().into_inner(),
+ );
delete
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(DeleteType::Delete)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
send_to_community(delete, &creator, &community, context).await?;
Ok(())
.await??;
// Generate a fake delete activity, with the correct object
- let mut delete = Delete::new(creator.actor_id.to_owned(), Url::parse(&self.ap_id)?);
+ let mut delete = Delete::new(
+ creator.actor_id.to_owned().into_inner(),
+ self.ap_id.to_owned().into_inner(),
+ );
delete
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(DeleteType::Delete)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
// Undo that fake activity
- let mut undo = Undo::new(creator.actor_id.to_owned(), delete.into_any_base()?);
+ let mut undo = Undo::new(
+ creator.actor_id.to_owned().into_inner(),
+ delete.into_any_base()?,
+ );
undo
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(UndoType::Undo)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
send_to_community(undo, &creator, &community, context).await?;
Ok(())
})
.await??;
- let mut remove = Remove::new(mod_.actor_id.to_owned(), Url::parse(&self.ap_id)?);
+ let mut remove = Remove::new(
+ mod_.actor_id.to_owned().into_inner(),
+ self.ap_id.to_owned().into_inner(),
+ );
remove
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(RemoveType::Remove)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
send_to_community(remove, &mod_, &community, context).await?;
Ok(())
.await??;
// Generate a fake delete activity, with the correct object
- let mut remove = Remove::new(mod_.actor_id.to_owned(), Url::parse(&self.ap_id)?);
+ let mut remove = Remove::new(
+ mod_.actor_id.to_owned().into_inner(),
+ self.ap_id.to_owned().into_inner(),
+ );
remove
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(RemoveType::Remove)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
// Undo that fake activity
- let mut undo = Undo::new(mod_.actor_id.to_owned(), remove.into_any_base()?);
+ let mut undo = Undo::new(
+ mod_.actor_id.to_owned().into_inner(),
+ remove.into_any_base()?,
+ );
undo
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(UndoType::Undo)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
send_to_community(undo, &mod_, &community, context).await?;
Ok(())
})
.await??;
- let mut like = Like::new(creator.actor_id.to_owned(), Url::parse(&self.ap_id)?);
+ let mut like = Like::new(
+ creator.actor_id.to_owned().into_inner(),
+ self.ap_id.to_owned().into_inner(),
+ );
like
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(LikeType::Like)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
send_to_community(like, &creator, &community, context).await?;
Ok(())
})
.await??;
- let mut dislike = Dislike::new(creator.actor_id.to_owned(), Url::parse(&self.ap_id)?);
+ let mut dislike = Dislike::new(
+ creator.actor_id.to_owned().into_inner(),
+ self.ap_id.to_owned().into_inner(),
+ );
dislike
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(DislikeType::Dislike)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
send_to_community(dislike, &creator, &community, context).await?;
Ok(())
})
.await??;
- let mut like = Like::new(creator.actor_id.to_owned(), Url::parse(&self.ap_id)?);
+ let mut like = Like::new(
+ creator.actor_id.to_owned().into_inner(),
+ self.ap_id.to_owned().into_inner(),
+ );
like
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(DislikeType::Dislike)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
// Undo that fake activity
- let mut undo = Undo::new(creator.actor_id.to_owned(), like.into_any_base()?);
+ let mut undo = Undo::new(
+ creator.actor_id.to_owned().into_inner(),
+ like.into_any_base()?,
+ );
undo
.set_many_contexts(lemmy_context()?)
.set_id(generate_activity_id(UndoType::Undo)?)
.set_to(public())
- .set_many_ccs(vec![community.actor_id()?]);
+ .set_many_ccs(vec![community.actor_id()]);
send_to_community(undo, &creator, &community, context).await?;
Ok(())
context: &LemmyContext,
) -> Result<MentionsAndAddresses, LemmyError> {
let parent_creator = get_comment_parent_creator(context.pool(), comment).await?;
- let mut addressed_ccs = vec![community.actor_id()?, parent_creator.actor_id()?];
+ let mut addressed_ccs = vec![community.actor_id(), parent_creator.actor_id()];
// Note: dont include community inbox here, as we send to it separately with `send_to_community()`
let mut inboxes = vec![parent_creator.get_shared_inbox_url()?];
link
.href
.to_owned()
- .map(|u| Url::parse(&u))
- .transpose()?
.ok_or_else(|| anyhow!("No href found.").into())
}