add reaction IDs in model

This commit is contained in:
FloatingGhost 2022-08-16 16:41:22 +01:00
parent 03af49798d
commit 41a3d7cb8e
3 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,6 @@ defmodule Pleroma.Web.MastodonAPI.NotificationController do
params =
Map.new(params, fn {k, v} -> {to_string(k), v} end)
|> Map.put_new("include_types", @default_notification_types)
notifications = MastodonAPI.get_notifications(user, params)
conn

View File

@ -590,7 +590,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
name: emoji,
count: length(users),
url: MediaProxy.url(url),
me: !!(current_user && current_user.ap_id in users)
me: !!(current_user && current_user.ap_id in users),
account_ids: Enum.map(users, fn user -> User.get_cached_by_ap_id(user).id end)
}
end

View File

@ -72,7 +72,7 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
# We only receive pings for now
def websocket_handle(:ping, state), do: {:ok, state}
def websocket_handle({:text, "ping"}, state) do
def websocket_handle({:text, ping}, state) when ping in ~w[ping PING] do
if state.timer, do: Process.cancel_timer(state.timer)
{:reply, {:text, "pong"}, %{state | timer: timer()}}
end