From 1633470e4af885527eac4a6e4076acf14616d4d9 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 19 Feb 2018 09:50:41 +0100 Subject: [PATCH] TwitterAPI: Only fetch creates, announces, follows. --- lib/pleroma/web/twitter_api/twitter_api.ex | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index 411c2f812..a8bdbe716 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -16,26 +16,34 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do opts = opts |> Map.put("blocking_user", user) |> Map.put("user", user) + |> Map.put("type", ["Create", "Announce", "Follow"]) ActivityPub.fetch_activities([user.ap_id | user.following], opts) |> activities_to_statuses(%{for: user}) end def fetch_public_statuses(user, opts \\ %{}) do - opts = Map.put(opts, "local_only", true) - opts = Map.put(opts, "blocking_user", user) + opts = opts + |> Map.put("local_only", true) + |> Map.put("blocking_user", user) + |> Map.put("type", ["Create", "Announce", "Follow"]) + ActivityPub.fetch_public_activities(opts) |> activities_to_statuses(%{for: user}) end def fetch_public_and_external_statuses(user, opts \\ %{}) do - opts = Map.put(opts, "blocking_user", user) + opts = opts + |> Map.put("blocking_user", user) + |> Map.put("type", ["Create", "Announce", "Follow"]) + ActivityPub.fetch_public_activities(opts) |> activities_to_statuses(%{for: user}) end def fetch_user_statuses(user, opts \\ %{}) do ActivityPub.fetch_activities([], opts) + |> Map.put("type", ["Create", "Announce", "Follow"]) |> activities_to_statuses(%{for: user}) end -- 2.45.2