Use follower address in user entry.
authorRoger Braun <roger@rogerbraun.net>
Wed, 19 Jul 2017 17:06:49 +0000 (19:06 +0200)
committerRoger Braun <roger@rogerbraun.net>
Wed, 19 Jul 2017 17:06:49 +0000 (19:06 +0200)
lib/pleroma/web/activity_pub/utils.ex
lib/pleroma/web/ostatus/handlers/note_handler.ex
lib/pleroma/web/twitter_api/twitter_api.ex
test/web/twitter_api/twitter_api_test.exs

index ed5ae021e4f026eb15119808c41d788154be8182..ef58b88d203ca483995cba0e072ef6369b078583 100644 (file)
@@ -99,7 +99,7 @@ defmodule Pleroma.Web.ActivityPub.Utils do
       "type" => "Like",
       "actor" => ap_id,
       "object" => id,
-      "to" => [User.ap_followers(actor), object.data["actor"]],
+      "to" => [actor.follower_address, object.data["actor"]],
       "context" => object.data["context"]
     }
 
@@ -167,7 +167,7 @@ defmodule Pleroma.Web.ActivityPub.Utils do
       "type" => "Announce",
       "actor" => ap_id,
       "object" => id,
-      "to" => [User.ap_followers(user), object.data["actor"]],
+      "to" => [user.follower_address, object.data["actor"]],
       "context" => object.data["context"]
     }
 
index e0e4afef690f6283d5a69c996692e441cdd16e35..f675901b208305f5551b2cf4a4999a4b0eb007cf 100644 (file)
@@ -61,7 +61,7 @@ defmodule Pleroma.Web.OStatus.NoteHandler do
 
   def make_to_list(actor, mentions) do
     [
-      User.ap_followers(actor)
+      actor.follower_address
     ] ++ mentions
   end
 
index b5b59eb4bea4415cf4797a2e66a4977875aa2b80..04c1d914cba96e4a5dfc9291a3a3dbb09a8d7d1c 100644 (file)
@@ -12,7 +12,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
 
   def to_for_user_and_mentions(user, mentions, inReplyTo) do
     default_to = [
-      User.ap_followers(user),
+      user.follower_address,
       "https://www.w3.org/ns/activitystreams#Public"
     ]
 
index 080e5f86ae4ecfada5de1731cdfaf252bfd26bee..48d48eb2b98664456aa26b3db78a7d212f3f7079 100644 (file)
@@ -9,7 +9,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
   import Pleroma.Factory
 
   test "create a status" do
-    user = UserBuilder.build(%{ap_id: "142344"})
+    # user = UserBuilder.build(%{ap_id: "142344"})
+    user = insert(:user, %{ap_id: "142344"})
     _mentioned_user = UserBuilder.insert(%{nickname: "shp", ap_id: "shp"})
 
     object_data = %{