From c4e0c244085b7a6d13b84904420e99675f9caf26 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 30 Sep 2024 20:32:09 -0400 Subject: [PATCH] Simpler activitypub vote check. --- crates/apub/src/activities/voting/vote.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/apub/src/activities/voting/vote.rs b/crates/apub/src/activities/voting/vote.rs index 9851f3d88..1cdc81952 100644 --- a/crates/apub/src/activities/voting/vote.rs +++ b/crates/apub/src/activities/voting/vote.rs @@ -79,10 +79,8 @@ impl ActivityHandler for Vote { }; // Don't allow dislikes for either disabled, or local only votes - let downvote_fail = self.kind == VoteType::Dislike - && [FederationMode::Disable, FederationMode::Local].contains(&downvote_setting); - let upvote_fail = self.kind == VoteType::Like - && [FederationMode::Disable, FederationMode::Local].contains(&upvote_setting); + let downvote_fail = self.kind == VoteType::Dislike && downvote_setting != FederationMode::All; + let upvote_fail = self.kind == VoteType::Like && upvote_setting != FederationMode::All; if downvote_fail || upvote_fail { // If this is a rejection, undo the vote