diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-11-03 08:13:39 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-11-03 08:13:39 +0100 |
commit | 8a1a7191fd9348fb35fc1aa322dd90869c7dfceb (patch) | |
tree | 40ba4b7873f55910edae9231cba3417fb1313260 /lib | |
parent | 9554436d61de3e76f8cf9239ca03b0b1b41f4096 (diff) | |
download | pleroma-8a1a7191fd9348fb35fc1aa322dd90869c7dfceb.tar.gz |
MastoAPI: Fix mentions always being for an anonymous user.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 9399dee86..19e0be3a1 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -183,13 +183,13 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do |> String.replace(~r/(\.\d+)?$/, ".000Z", global: false) case activity.data["type"] do "Create" -> - %{id: id, type: "mention", created_at: created_at, account: AccountView.render("account.json", %{user: actor}), status: StatusView.render("status.json", %{activity: activity})} + %{id: id, type: "mention", created_at: created_at, account: AccountView.render("account.json", %{user: actor}), status: StatusView.render("status.json", %{activity: activity, for: user})} "Like" -> liked_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"]) - %{id: id, type: "favourite", created_at: created_at, account: AccountView.render("account.json", %{user: actor}), status: StatusView.render("status.json", %{activity: liked_activity})} + %{id: id, type: "favourite", created_at: created_at, account: AccountView.render("account.json", %{user: actor}), status: StatusView.render("status.json", %{activity: liked_activity, for: user})} "Announce" -> announced_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"]) - %{id: id, type: "reblog", created_at: created_at, account: AccountView.render("account.json", %{user: actor}), status: StatusView.render("status.json", %{activity: announced_activity})} + %{id: id, type: "reblog", created_at: created_at, account: AccountView.render("account.json", %{user: actor}), status: StatusView.render("status.json", %{activity: announced_activity, for: user})} "Follow" -> %{id: id, type: "follow", created_at: created_at, account: AccountView.render("account.json", %{user: actor})} _ -> nil |