let object = Follow::new(actor, community, context)?;
let undo = UndoFollow {
actor: actor.id().into(),
+ to: Some([community.id().into()]),
object,
kind: UndoType::Undo,
id: generate_activity_id(
verify_urls_match(self.actor.inner(), self.object.actor.inner())?;
verify_person(&self.actor, context).await?;
self.object.verify(context).await?;
+ if let Some(to) = &self.to {
+ verify_urls_match(to[0].inner(), self.object.object.inner())?;
+ }
Ok(())
}
follower_id: person.id,
pending: false,
};
- PersonFollower::unfollow(context.pool(), &form).await?;
+ PersonFollower::unfollow(&mut context.pool(), &form).await?;
}
UserOrCommunity::Community(c) => {
let form = CommunityFollowerForm {
person_id: person.id,
pending: false,
};
- CommunityFollower::unfollow(context.pool(), &form).await?;
+ CommunityFollower::unfollow(&mut context.pool(), &form).await?;
}
}