mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-25 02:19:31 +00:00
mastodon api: fix up quite a few test failures
This commit is contained in:
parent
ef6c64a5d2
commit
3456948cd1
|
@ -659,7 +659,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
|
|
||||||
# TODO: Use proper query
|
# TODO: Use proper query
|
||||||
def blocks(%{assigns: %{user: user}} = conn, _) do
|
def blocks(%{assigns: %{user: user}} = conn, _) do
|
||||||
with blocked_users <- user.info["blocks"] || [],
|
with blocked_users <- user.info.blocks || [],
|
||||||
accounts <- Enum.map(blocked_users, fn ap_id -> User.get_cached_by_ap_id(ap_id) end) do
|
accounts <- Enum.map(blocked_users, fn ap_id -> User.get_cached_by_ap_id(ap_id) end) do
|
||||||
res = AccountView.render("accounts.json", users: accounts, for: user, as: :user)
|
res = AccountView.render("accounts.json", users: accounts, for: user, as: :user)
|
||||||
json(conn, res)
|
json(conn, res)
|
||||||
|
@ -667,7 +667,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain_blocks(%{assigns: %{user: %{info: info}}} = conn, _) do
|
def domain_blocks(%{assigns: %{user: %{info: info}}} = conn, _) do
|
||||||
json(conn, info["domain_blocks"] || [])
|
json(conn, info.domain_blocks || [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def block_domain(%{assigns: %{user: blocker}} = conn, %{"domain" => domain}) do
|
def block_domain(%{assigns: %{user: blocker}} = conn, %{"domain" => domain}) do
|
||||||
|
@ -915,11 +915,11 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
max_toot_chars: limit
|
max_toot_chars: limit
|
||||||
},
|
},
|
||||||
rights: %{
|
rights: %{
|
||||||
delete_others_notice: !!user.info["is_moderator"]
|
delete_others_notice: !!user.info.is_moderator
|
||||||
},
|
},
|
||||||
compose: %{
|
compose: %{
|
||||||
me: "#{user.id}",
|
me: "#{user.id}",
|
||||||
default_privacy: user.info["default_scope"] || "public",
|
default_privacy: user.info.default_scope || "public",
|
||||||
default_sensitive: false
|
default_sensitive: false
|
||||||
},
|
},
|
||||||
media_attachments: %{
|
media_attachments: %{
|
||||||
|
|
Loading…
Reference in a new issue