X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fpleroma%2Fweb%2Ftwitter_api%2Ftwitter_api.ex;h=932bef5efa7a5127d14cc96bdbadb7550b7346a8;hb=8f43992121a726df2faaf04bf918f32f708d10f8;hp=e1b6f248713c5fadbaeff35200d48d2f65dd4e6c;hpb=8075badafe60d396c236d8d6d911cbb60ae9c5b6;p=akkoma diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index e1b6f2487..932bef5ef 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -6,8 +6,6 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do import Ecto.Query def create_status(user = %User{}, data = %{}) do - date = DateTime.utc_now() |> DateTime.to_iso8601 - attachments = Enum.map(data["media_ids"] || [], fn (media_id) -> Repo.get(Object, media_id).data end) @@ -35,11 +33,11 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do "type" => "Note", "to" => to, "content" => content_html, - "published" => date, + "published" => make_date, "context" => context, "attachment" => attachments }, - "published" => date, + "published" => make_date, "context" => context } @@ -107,7 +105,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do { :ok, activity } <- ActivityPub.insert(%{ "type" => "Follow", "actor" => follower.ap_id, - "object" => followed.ap_id + "object" => followed.ap_id, + "published" => make_date }) do { :ok, follower, followed, activity } @@ -183,4 +182,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do mentioned_users = Repo.all(from user in User, where: user.ap_id in ^activity.data["to"]) ActivityRepresenter.to_map(activity, Map.merge(opts, %{user: user, mentioned: mentioned_users})) end + + defp make_date do + DateTime.utc_now() |> DateTime.to_iso8601 + end end