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}),
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}),
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}),
"Follow" ->
%{
- id: id |> to_string,
+ id: id,
type: "follow",
created_at: created_at,
account: AccountView.render("account.json", %{user: actor})