mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Simpler activitypub vote check.
This commit is contained in:
parent
f583041d5f
commit
c4e0c24408
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user