summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKokaKiwi <kokakiwi@kokakiwi.net>2018-11-11 04:33:14 +0100
committerKokaKiwi <kokakiwi@kokakiwi.net>2018-11-11 14:18:15 +0100
commit1592fa2bea45eeea770044d619868087ef2591cb (patch)
tree63b593edd5cf55458c6186dec87e8ea7f166153a
parent617aff4f0c86de298439f64df43d7e95364530c0 (diff)
downloadpleroma-1592fa2bea45eeea770044d619868087ef2591cb.tar.gz
pleroma-1592fa2bea45eeea770044d619868087ef2591cb.zip
Mastodon API: Fix list streaming
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_socket.ex10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_socket.ex b/lib/pleroma/web/mastodon_api/mastodon_socket.ex
index bc628ba56..0f3d5ff7c 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_socket.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_socket.ex
@@ -26,15 +26,19 @@ defmodule Pleroma.Web.MastodonAPI.MastodonSocket do
"list",
"hashtag"
] <- params["stream"] do
- topic = if stream == "list", do: "list:#{params["list"]}", else: stream
- socket_stream = if stream == "hashtag", do: "hashtag:#{params["tag"]}", else: stream
+ topic =
+ case stream do
+ "hashtag" -> "hashtag:#{params["tag"]}"
+ "list" -> "list:#{params["list"]}"
+ _ -> stream
+ end
socket =
socket
|> assign(:topic, topic)
|> assign(:user, user)
- Pleroma.Web.Streamer.add_socket(socket_stream, socket)
+ Pleroma.Web.Streamer.add_socket(topic, socket)
{:ok, socket}
else
_e -> :error