]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/activities/voting/vote.rs
implement language tags for site/community in db and api (#2434)
[lemmy.git] / crates / apub / src / activities / voting / vote.rs
index b4f4423880153cbe45fc65f3eb7e1d15a1ecc06e..5b8a4adf25804cf2b7605b6ea22a5d7450a40c96 100644 (file)
@@ -31,13 +31,11 @@ impl Vote {
   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(),
@@ -59,7 +57,7 @@ impl Vote {
     })
     .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
@@ -87,7 +85,7 @@ impl ActivityHandler for Vote {
   ) -> 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());
     }