Commit da64ea4a authored by vaartis's avatar vaartis
Browse files

Implement mastodon mutes endpoint

Aparently i forgot to add it, it gets a list of muted users
parent f41f017b
......@@ -780,6 +780,15 @@ def unmute(%{assigns: %{user: muter}} = conn, %{"id" => id}) do
# TODO: Use proper query
def mutes(%{assigns: %{user: user}} = conn, _) do
with muted_users <-["mutes"] || [],
accounts <-, fn ap_id -> User.get_cached_by_ap_id(ap_id) end) do
res = AccountView.render("accounts.json", users: accounts, for: user, as: :user)
json(conn, res)
def block(%{assigns: %{user: blocker}} = conn, %{"id" => id}) do
with %User{} = blocked <- Repo.get(User, id),
{:ok, blocker} <- User.block(blocker, blocked),
......@@ -178,7 +178,7 @@ defmodule Pleroma.Web.Router do
get("/blocks", MastodonAPIController, :blocks)
get("/mutes", MastodonAPIController, :empty_array)
get("/mutes", MastodonAPIController, :mutes)
get("/timelines/home", MastodonAPIController, :home_timeline)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment