Merge pull request #4881 from nottalulah/patch-1

Hide posts not visible to anonymous users from Discord slash commands
This commit is contained in:
evazion
2021-09-17 19:18:42 -05:00
committed by GitHub

View File

@@ -56,8 +56,12 @@ class DiscordSlashCommand
{ text: text }
end
def censored_tags
["guro", "bestiality"]
end
def is_censored?
post.rating != "s" && !is_nsfw_channel?
(post.rating != "s" && !is_nsfw_channel?) || !post.visible?(User.anonymous) || censored_tags.any? { |tag| tag.in?(post.tag_array) }
end
def is_nsfw_channel?