mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 11:19:19 +00:00
Mastodon API: Fix list streaming
This commit is contained in:
parent
617aff4f0c
commit
1592fa2bea
1 changed files with 7 additions and 3 deletions
|
@ -26,15 +26,19 @@ defmodule Pleroma.Web.MastodonAPI.MastodonSocket do
|
||||||
"list",
|
"list",
|
||||||
"hashtag"
|
"hashtag"
|
||||||
] <- params["stream"] do
|
] <- params["stream"] do
|
||||||
topic = if stream == "list", do: "list:#{params["list"]}", else: stream
|
topic =
|
||||||
socket_stream = if stream == "hashtag", do: "hashtag:#{params["tag"]}", else: stream
|
case stream do
|
||||||
|
"hashtag" -> "hashtag:#{params["tag"]}"
|
||||||
|
"list" -> "list:#{params["list"]}"
|
||||||
|
_ -> stream
|
||||||
|
end
|
||||||
|
|
||||||
socket =
|
socket =
|
||||||
socket
|
socket
|
||||||
|> assign(:topic, topic)
|
|> assign(:topic, topic)
|
||||||
|> assign(:user, user)
|
|> assign(:user, user)
|
||||||
|
|
||||||
Pleroma.Web.Streamer.add_socket(socket_stream, socket)
|
Pleroma.Web.Streamer.add_socket(topic, socket)
|
||||||
{:ok, socket}
|
{:ok, socket}
|
||||||
else
|
else
|
||||||
_e -> :error
|
_e -> :error
|
||||||
|
|
Loading…
Reference in a new issue