aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshadowfacts <me@shadowfacts.net>2018-09-03 01:52:02 +0000
committershadowfacts <me@shadowfacts.net>2018-09-03 01:52:02 +0000
commit26f8697400cf9c9fd4d33748bf3aadedbb55d981 (patch)
tree919f4bd0114e78eae97b595e09c9bef84a412665 /lib
parent2b2bd0e047c96085dda003f0ae11ddc05bbc8c12 (diff)
downloadpleroma-26f8697400cf9c9fd4d33748bf3aadedbb55d981.tar.gz
Update mastodon_api_controller.ex
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api_controller.ex10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index b3c234010..576e9d3ce 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -1029,11 +1029,13 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
created_at =
NaiveDateTime.to_iso8601(created_at)
|> String.replace(~r/(\.\d+)?$/, ".000Z", global: false)
+
+ id = id |> to_string
case activity.data["type"] do
"Create" ->
%{
- id: id |> to_string,
+ id: id,
type: "mention",
created_at: created_at,
account: AccountView.render("account.json", %{user: actor}),
@@ -1044,7 +1046,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
liked_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"])
%{
- id: id |> to_string,
+ id: id,
type: "favourite",
created_at: created_at,
account: AccountView.render("account.json", %{user: actor}),
@@ -1055,7 +1057,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
announced_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"])
%{
- id: id |> to_string,
+ id: id,
type: "reblog",
created_at: created_at,
account: AccountView.render("account.json", %{user: actor}),
@@ -1064,7 +1066,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
"Follow" ->
%{
- id: id |> to_string,
+ id: id,
type: "follow",
created_at: created_at,
account: AccountView.render("account.json", %{user: actor})