Twitter Representers: Handle Mastodon attachments.
[akkoma] / lib / pleroma / web / mastodon_api / mastodon_socket.ex
index af76c87015cb687b5d5e8fc0684c60d9ca1e3c1b..fe71ea271841ccec8d3ccf265d2dec5fb05e456f 100644 (file)
@@ -11,7 +11,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonSocket do
     with token when not is_nil(token) <- params["access_token"],
          %Token{user_id: user_id} <- Repo.get_by(Token, token: token),
          %User{} = user <- Repo.get(User, user_id),
-         stream when stream in ["public", "public:local"] <- params["stream"] do
+         stream when stream in ["public", "public:local", "user"] <- params["stream"] do
       socket = socket
       |> assign(:topic, params["stream"])
       |> assign(:user, user)
@@ -22,9 +22,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonSocket do
     end
   end
 
-  def id(socket), do: nil
+  def id(_), do: nil
 
-  def handle(:text, message, state) do
+  def handle(:text, message, _state) do
     IO.inspect message
     #| :ok
     #| state
@@ -34,7 +34,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonSocket do
     {:text, message}
   end
 
-  def handle(:closed, reason, %{socket: socket}) do
+  def handle(:closed, _, %{socket: socket}) do
     topic = socket.assigns[:topic]
     Pleroma.Web.Streamer.remove_socket(topic, socket)
   end