pub(in crate::activities::voting) fn new(
object: &PostOrComment,
actor: &ApubPerson,
- community: &ApubCommunity,
kind: VoteType,
context: &LemmyContext,
) -> Result<Vote, LemmyError> {
Ok(Vote {
actor: ObjectId::new(actor.actor_id()),
- to: vec![community.actor_id()],
object: ObjectId::new(object.ap_id()),
cc: vec![public()],
kind: kind.clone(),
})
.await??
.into();
- let vote = Vote::new(object, actor, &community, kind, context)?;
+ let vote = Vote::new(object, actor, kind, context)?;
let activity = AnnouncableActivities::Vote(vote);
send_activity_in_community(activity, actor, &community, vec![], context).await
) -> Result<(), LemmyError> {
let community = self.get_community(context, request_counter).await?;
verify_person_in_community(&self.actor, &community, context, request_counter).await?;
- let site = blocking(context.pool(), Site::read_local_site).await??;
+ let site = blocking(context.pool(), Site::read_local).await??;
if self.kind == VoteType::Dislike && !site.enable_downvotes {
return Err(anyhow!("Downvotes disabled").into());
}