Browse Source

Update mastodon_api_controller.ex

tags/v0.9.9
shadowfacts 5 years ago
parent
commit
26f8697400
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      lib/pleroma/web/mastodon_api/mastodon_api_controller.ex

+ 6
- 4
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex View File

@@ -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})


Loading…
Cancel
Save