From 01faa7c555061aed79ec932c0065bf77818f3125 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 19 Feb 2018 09:50:57 +0100 Subject: [PATCH] TwitterAPI: support follow activities without published date. --- .../web/twitter_api/representers/activity_representer.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex index f9f9bd7b4..98be18c98 100644 --- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex +++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex @@ -56,7 +56,8 @@ def to_map(%Activity{data: %{"type" => "Like", "published" => created_at}} = act } end - def to_map(%Activity{data: %{"type" => "Follow", "published" => created_at, "object" => followed_id}} = activity, %{user: user} = opts) do + def to_map(%Activity{data: %{"type" => "Follow", "object" => followed_id}} = activity, %{user: user} = opts) do + created_at = activity.data["published"] || (DateTime.to_iso8601(activity.inserted_at)) created_at = created_at |> Utils.date_to_asctime followed = User.get_cached_by_ap_id(followed_id)