Merge branch 'patch-3' into 'develop'
authorrinpatch <rinpatch@sdf.org>
Wed, 7 Aug 2019 22:14:02 +0000 (22:14 +0000)
committerrinpatch <rinpatch@sdf.org>
Wed, 7 Aug 2019 22:14:02 +0000 (22:14 +0000)
Return profile URL when available instead of actor URI for MastodonAPI mention URL

Closes #1165

See merge request pleroma/pleroma!1541

lib/pleroma/web/mastodon_api/views/account_view.ex

index b2b06eeb9d305b7734a6f1bfd2a50f694b01e138..de084fd6ef0c61fd440914e0c8f34fb20c12f90c 100644 (file)
@@ -28,7 +28,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
       id: to_string(user.id),
       acct: user.nickname,
       username: username_from_nickname(user.nickname),
-      url: user.ap_id
+      url: User.profile_url(user)
     }
   end
 
@@ -106,7 +106,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
       following_count: user_info.following_count,
       statuses_count: user_info.note_count,
       note: bio || "",
-      url: user.ap_id,
+      url: User.profile_url(user),
       avatar: image,
       avatar_static: image,
       header: header,