Fix tests
authorEgor Kislitsyn <egor@kislitsyn.com>
Tue, 12 Nov 2019 12:13:19 +0000 (19:13 +0700)
committerEgor Kislitsyn <egor@kislitsyn.com>
Tue, 12 Nov 2019 12:13:19 +0000 (19:13 +0700)
lib/pleroma/web/common_api/utils.ex

index 43b67d0f07661784f05d5ca835d65fd6b0ac5781..cbb64f8d24f1c3cd2b2d4e4d8e96791504247a57 100644 (file)
@@ -486,8 +486,12 @@ defmodule Pleroma.Web.CommonAPI.Utils do
     recipients
   end
 
-  def maybe_notify_subscribers(recipients, %Activity{data: %{"type" => "Create"}} = activity) do
-    with %User{} = user <- User.get_cached_by_ap_id(activity.actor) do
+  def maybe_notify_subscribers(
+        recipients,
+        %Activity{data: %{"actor" => actor, "type" => type}} = activity
+      )
+      when type == "Create" do
+    with %User{} = user <- User.get_cached_by_ap_id(actor) do
       subscriber_ids =
         user
         |> User.subscribers()