Return directly addressed activities in friends timeline.
authorRoger Braun <roger@rogerbraun.net>
Wed, 12 Apr 2017 14:45:23 +0000 (16:45 +0200)
committerRoger Braun <roger@rogerbraun.net>
Wed, 12 Apr 2017 14:45:23 +0000 (16:45 +0200)
lib/pleroma/web/twitter_api/twitter_api.ex
test/web/twitter_api/twitter_api_test.exs

index 0a942e880e538d1e92fd67f80a4b0ee1c1080828..0217b28d64139a815636f36a3908b3e1605fd732 100644 (file)
@@ -69,7 +69,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
   end
 
   def fetch_friend_statuses(user, opts \\ %{}) do
-    ActivityPub.fetch_activities(user.following, opts)
+    ActivityPub.fetch_activities([user.ap_id | user.following], opts)
     |> activities_to_statuses(%{for: user})
   end
 
index ad932131ac2522ccf153d158368f0562ba7b4aaa..dcb38b8b16995ea78cd32c8eabc7a9922e37a985 100644 (file)
@@ -82,14 +82,16 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
 
   test "fetch friends' statuses" do
     ActivityBuilder.public_and_non_public
+
     {:ok, activity} = ActivityBuilder.insert(%{"to" => ["someguy/followers"]})
+    {:ok, direct_activity} = ActivityBuilder.insert(%{"to" => ["some other id"]})
     {:ok, user} = UserBuilder.insert(%{ap_id: "some other id", following: ["someguy/followers"]})
 
     statuses = TwitterAPI.fetch_friend_statuses(user)
 
     activity_user = Repo.get_by(User, ap_id: activity.data["actor"])
 
-    assert length(statuses) == 1
+    assert length(statuses) == 2
     assert Enum.at(statuses, 0) == ActivityRepresenter.to_map(activity, %{user: activity_user})
   end