Stop filtering out toots with language set to `""` (#100)

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 15:43:50 -04:00 committed by GitHub
parent a6b4d968cb
commit 8797a47efd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}
}