From bd4aa0aabda4a2986e6145e3a793e8b2a391f8dd Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Mon, 2 Jul 2018 09:44:32 -0700 Subject: Fix 'nsfw-' case in utils::is_nsfw In the utils::is_nsfw function, an input of 'nsfw-' shouldn't return true. Discord's (previous) NSFW detection classified 'nsfw' and anything starting with 'nsfw-' - but not including - as NSFW. --- src/utils/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 5eba1ff..dad5112 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -96,7 +96,7 @@ pub fn is_nsfw(name: &str) -> bool { if char_count == 4 { name == "nsfw" - } else if char_count > 4 { + } else if char_count > 5 { name.starts_with("nsfw-") } else { false -- cgit v1.2.3