Fix double-escaping of delete payload (#95)

This commit is contained in:
Daniel Sockwell 2020-03-19 12:10:59 -04:00 committed by GitHub
parent 8843f18f5f
commit dc6256d521
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

2
Cargo.lock generated
View File

@ -440,7 +440,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "flodgatt"
version = "0.5.0"
version = "0.6.1"
dependencies = [
"criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dotenv 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",

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.0"
version = "0.6.1"
authors = ["Daniel Long Sockwell <daniel@codesections.com", "Julian Laubstein <contact@julianlaubstein.de>"]
edition = "2018"

View File

@ -25,7 +25,12 @@ impl Message {
"update" => Self::Update(Status(json["payload"].clone())),
"conversation" => Self::Conversation(json["payload"].clone()),
"notification" => Self::Notification(json["payload"].clone()),
"delete" => Self::Delete(json["payload"].to_string()),
"delete" => Self::Delete(
json["payload"]
.as_str()
.unwrap_or_else(|| log_fatal!("Could not process `payload` in {:?}", json))
.to_string(),
),
"filters_changed" => Self::FiltersChanged,
unsupported_event => log_fatal!(
"Received an unsupported `event` type from Redis: {}",