mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-23 06:58:58 +00:00
MastoAPI: Always return an url for statuses.
External url if available, id if not.
This commit is contained in:
parent
f23edd2d6b
commit
ce7f9f527c
|
@ -80,7 +80,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
||||||
%{
|
%{
|
||||||
id: activity.id,
|
id: activity.id,
|
||||||
uri: object["id"],
|
uri: object["id"],
|
||||||
url: object["external_url"],
|
url: object["external_url"] || object["id"],
|
||||||
account: AccountView.render("account.json", %{user: user}),
|
account: AccountView.render("account.json", %{user: user}),
|
||||||
in_reply_to_id: reply_to && reply_to.id,
|
in_reply_to_id: reply_to && reply_to.id,
|
||||||
in_reply_to_account_id: reply_to_user && reply_to_user.id,
|
in_reply_to_account_id: reply_to_user && reply_to_user.id,
|
||||||
|
|
|
@ -19,7 +19,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
||||||
expected = %{
|
expected = %{
|
||||||
id: note.id,
|
id: note.id,
|
||||||
uri: note.data["object"]["id"],
|
uri: note.data["object"]["id"],
|
||||||
url: note.data["object"]["external_id"],
|
url: note.data["object"]["id"],
|
||||||
account: AccountView.render("account.json", %{user: user}),
|
account: AccountView.render("account.json", %{user: user}),
|
||||||
in_reply_to_id: nil,
|
in_reply_to_id: nil,
|
||||||
in_reply_to_account_id: nil,
|
in_reply_to_account_id: nil,
|
||||||
|
|
Loading…
Reference in a new issue