Stop filtering out toots with language set to `""`

Previously, if a toot's language was `null`, then it would be
permitted regardless of the user's language filter; however, if it
were `""` (the empty string) it was rejected.  Now, the empty string
is treated like `null` and the toot is allowed.
This commit is contained in:
Daniel Sockwell 2020-03-20 14:45:13 -04:00
parent a6b4d968cb
commit 9ee9d4d4f9
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
[package]
name = "flodgatt"
description = "A blazingly fast drop-in replacement for the Mastodon streaming api server"
version = "0.6.3"
version = "0.6.4"
authors = ["Daniel Long Sockwell <daniel@codesections.com", "Julian Laubstein <contact@julianlaubstein.de>"]
edition = "2018"

View File

@ -102,8 +102,8 @@ impl Status {
}
match self.0["language"].as_str() {
Some(toot_language) if allowed_langs.contains(toot_language) => ALLOW,
None | Some("") => ALLOW, // If toot language is unknown, toot is always allowed
Some(toot_language) => reject_and_maybe_log(toot_language),
None => ALLOW, // If toot language is null, toot is always allowed
}
}