aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-07-02 09:44:32 -0700
committerZeyla Hellyer <[email protected]>2018-07-02 09:44:32 -0700
commitbd4aa0aabda4a2986e6145e3a793e8b2a391f8dd (patch)
tree1a4b2901a5c37ae3dac8f5e586d3fec0260ce622 /src/utils
parentFix utils::is_nsfw string slicing (diff)
downloadserenity-bd4aa0aabda4a2986e6145e3a793e8b2a391f8dd.tar.xz
serenity-bd4aa0aabda4a2986e6145e3a793e8b2a391f8dd.zip
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.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs2
1 files changed, 1 insertions, 1 deletions
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