Use `User.is_internal_user?` instead
authorkPherox <admin@mail.kr-kp.com>
Wed, 27 May 2020 05:24:36 +0000 (05:24 +0000)
committerkPherox <admin@mail.kr-kp.com>
Fri, 29 May 2020 10:07:05 +0000 (19:07 +0900)
lib/pleroma/web/activity_pub/side_effects.ex

index 60ab8733d4c9a0a602c85678d1ff1e9007c658d6..fb627545041c26f6520958dcd81c401c63e1e714 100644 (file)
@@ -11,7 +11,6 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
   alias Pleroma.Repo
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
-  alias Pleroma.Web.ActivityPub.Relay
   alias Pleroma.Web.ActivityPub.Utils
 
   def handle(object, meta \\ [])
@@ -34,10 +33,11 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
   # - Stream out the announce
   def handle(%{data: %{"type" => "Announce"}} = object, meta) do
     announced_object = Object.get_by_ap_id(object.data["object"])
+    user = User.get_cached_by_ap_id(object.data["actor"])
 
     Utils.add_announce_to_object(object, announced_object)
 
-    if object.data["actor"] != Relay.relay_ap_id() do
+    if !User.is_internal_user?(user) do
       Notification.create_notifications(object)
       ActivityPub.stream_out(object)
     end