mirror of https://github.com/mastodon/flodgatt
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:
parent
a6b4d968cb
commit
8797a47efd
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "flodgatt"
|
name = "flodgatt"
|
||||||
description = "A blazingly fast drop-in replacement for the Mastodon streaming api server"
|
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>"]
|
authors = ["Daniel Long Sockwell <daniel@codesections.com", "Julian Laubstein <contact@julianlaubstein.de>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,8 @@ impl Status {
|
||||||
}
|
}
|
||||||
match self.0["language"].as_str() {
|
match self.0["language"].as_str() {
|
||||||
Some(toot_language) if allowed_langs.contains(toot_language) => ALLOW,
|
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),
|
Some(toot_language) => reject_and_maybe_log(toot_language),
|
||||||
None => ALLOW, // If toot language is null, toot is always allowed
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue