forked from AkkomaGang/akkoma
fix most tests
This commit is contained in:
parent
dd66cc2ca6
commit
3b8e5bcbeb
3 changed files with 5 additions and 5 deletions
|
@ -134,7 +134,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity}
|
||||||
%{
|
%{
|
||||||
id: to_string(activity.id),
|
id: to_string(activity.id),
|
||||||
uri: object.data["id"],
|
uri: object.data["id"],
|
||||||
url: object.data["external_url"] || object["id"],
|
url: object.data["external_url"] || object.data["id"],
|
||||||
account: AccountView.render("account.json", %{user: user}),
|
account: AccountView.render("account.json", %{user: user}),
|
||||||
in_reply_to_id: reply_to && to_string(reply_to.id),
|
in_reply_to_id: reply_to && to_string(reply_to.id),
|
||||||
in_reply_to_account_id: reply_to_user && to_string(reply_to_user.id),
|
in_reply_to_account_id: reply_to_user && to_string(reply_to_user.id),
|
||||||
|
@ -149,7 +149,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity}
|
||||||
muted: false,
|
muted: false,
|
||||||
sensitive: sensitive,
|
sensitive: sensitive,
|
||||||
spoiler_text: object.data["summary"] || "",
|
spoiler_text: object.data["summary"] || "",
|
||||||
visibility: get_visibility(object),
|
visibility: get_visibility(object.data),
|
||||||
media_attachments: attachments |> Enum.take(4),
|
media_attachments: attachments |> Enum.take(4),
|
||||||
mentions: mentions,
|
mentions: mentions,
|
||||||
# fix,
|
# fix,
|
||||||
|
|
|
@ -167,14 +167,14 @@ def to_map(
|
||||||
|
|
||||||
tags = if possibly_sensitive, do: Enum.uniq(["nsfw" | tags]), else: tags
|
tags = if possibly_sensitive, do: Enum.uniq(["nsfw" | tags]), else: tags
|
||||||
|
|
||||||
{summary, content} = ActivityView.render_content(object)
|
{summary, content} = ActivityView.render_content(object.data)
|
||||||
|
|
||||||
html =
|
html =
|
||||||
HTML.filter_tags(content, User.html_filter_policy(opts[:for]))
|
HTML.filter_tags(content, User.html_filter_policy(opts[:for]))
|
||||||
|> Formatter.emojify(object.data["emoji"])
|
|> Formatter.emojify(object.data["emoji"])
|
||||||
|
|
||||||
video =
|
video =
|
||||||
if object["type"] == "Video" do
|
if object.data["type"] == "Video" do
|
||||||
vid = [object.data]
|
vid = [object.data]
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
|
|
|
@ -265,7 +265,7 @@ def render(
|
||||||
"tags" => tags,
|
"tags" => tags,
|
||||||
"activity_type" => "post",
|
"activity_type" => "post",
|
||||||
"possibly_sensitive" => possibly_sensitive,
|
"possibly_sensitive" => possibly_sensitive,
|
||||||
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
|
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object.data),
|
||||||
"summary" => summary
|
"summary" => summary
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue