diff options
author | lain <lain@soykaf.club> | 2018-02-19 09:50:57 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-02-19 09:50:57 +0100 |
commit | 01faa7c555061aed79ec932c0065bf77818f3125 (patch) | |
tree | 840db97b20a82dc18e1ddcf8b0831e41c8bd60cc | |
parent | 1633470e4af885527eac4a6e4076acf14616d4d9 (diff) | |
download | pleroma-01faa7c555061aed79ec932c0065bf77818f3125.tar.gz |
TwitterAPI: support follow activities without published date.
-rw-r--r-- | lib/pleroma/web/twitter_api/representers/activity_representer.ex | 3 |
1 files changed, 2 insertions, 1 deletions
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 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do } 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) |