API compatibility with fedibird, frontend config #163

Merged
floatingghost merged 9 commits from fedibird-compatibility into develop 2022-08-17 00:23:00 +00:00
3 changed files with 3 additions and 3 deletions
Showing only changes of commit 41a3d7cb8e - Show all commits

View file

@ -56,7 +56,6 @@ def index(%{assigns: %{user: user}} = conn, params) 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 @@ defp build_emoji_map(emoji, users, url, current_user) 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 @@ def websocket_handle(:pong, state) 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