diff options
author | lain <lain@soykaf.club> | 2019-02-20 17:36:16 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-02-20 17:36:16 +0100 |
commit | 59c27f29c8315b3de97c35d260a038a3f09c1885 (patch) | |
tree | 664749eba067c19cc89157f188d0d2e4d1f54cb9 /lib | |
parent | dff5e1e46ab5e622ae0cc4b4422ae57ce0a0d5de (diff) | |
download | pleroma-59c27f29c8315b3de97c35d260a038a3f09c1885.tar.gz |
Add some nicer urls in status view.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index a49b381c9..b90e4252a 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -144,10 +144,17 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do card = render("card.json", Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)) + url = + if user.local do + Pleroma.Web.Router.Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, activity) + else + object["external_url"] || object["id"] + end + %{ id: to_string(activity.id), uri: object["id"], - url: object["external_url"] || object["id"], + url: url, account: AccountView.render("account.json", %{user: user}), 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), |