mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 18:17:55 +00:00
Update mastodon_api_controller.ex
This commit is contained in:
parent
2b2bd0e047
commit
26f8697400
|
@ -1030,10 +1030,12 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
NaiveDateTime.to_iso8601(created_at)
|
NaiveDateTime.to_iso8601(created_at)
|
||||||
|> String.replace(~r/(\.\d+)?$/, ".000Z", global: false)
|
|> String.replace(~r/(\.\d+)?$/, ".000Z", global: false)
|
||||||
|
|
||||||
|
id = id |> to_string
|
||||||
|
|
||||||
case activity.data["type"] do
|
case activity.data["type"] do
|
||||||
"Create" ->
|
"Create" ->
|
||||||
%{
|
%{
|
||||||
id: id |> to_string,
|
id: id,
|
||||||
type: "mention",
|
type: "mention",
|
||||||
created_at: created_at,
|
created_at: created_at,
|
||||||
account: AccountView.render("account.json", %{user: actor}),
|
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"])
|
liked_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"])
|
||||||
|
|
||||||
%{
|
%{
|
||||||
id: id |> to_string,
|
id: id,
|
||||||
type: "favourite",
|
type: "favourite",
|
||||||
created_at: created_at,
|
created_at: created_at,
|
||||||
account: AccountView.render("account.json", %{user: actor}),
|
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"])
|
announced_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"])
|
||||||
|
|
||||||
%{
|
%{
|
||||||
id: id |> to_string,
|
id: id,
|
||||||
type: "reblog",
|
type: "reblog",
|
||||||
created_at: created_at,
|
created_at: created_at,
|
||||||
account: AccountView.render("account.json", %{user: actor}),
|
account: AccountView.render("account.json", %{user: actor}),
|
||||||
|
@ -1064,7 +1066,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
|
|
||||||
"Follow" ->
|
"Follow" ->
|
||||||
%{
|
%{
|
||||||
id: id |> to_string,
|
id: id,
|
||||||
type: "follow",
|
type: "follow",
|
||||||
created_at: created_at,
|
created_at: created_at,
|
||||||
account: AccountView.render("account.json", %{user: actor})
|
account: AccountView.render("account.json", %{user: actor})
|
||||||
|
|
Loading…
Reference in a new issue