-impl AcceptFollowCommunity {
- pub async fn send(
- follow: FollowCommunity,
- context: &LemmyContext,
- request_counter: &mut i32,
- ) -> Result<(), LemmyError> {
- let community = follow.object.dereference_local(context).await?;
- let person = follow
- .actor
- .clone()
- .dereference(context, request_counter)
- .await?;
- let accept = AcceptFollowCommunity {
- actor: ObjectId::new(community.actor_id()),
- to: [ObjectId::new(person.actor_id())],
+impl AcceptFollow {
+ #[tracing::instrument(skip_all)]
+ pub async fn send(follow: Follow, context: &Data<LemmyContext>) -> Result<(), LemmyError> {
+ let user_or_community = follow.object.dereference_local(context).await?;
+ let person = follow.actor.clone().dereference(context).await?;
+ let accept = AcceptFollow {
+ actor: user_or_community.id().into(),
+ to: Some([person.id().into()]),