Merge branch 'mix-tasks-improvement' into 'develop'
[akkoma] / lib / pleroma / notification.ex
index 3f749cacefe924c5392e9836e07b56686757fff3..32bcfcaba34d9c830211c3f8180481feff193b5d 100644 (file)
@@ -352,6 +352,7 @@ defmodule Pleroma.Notification do
     end
   end
 
+  @spec create_notifications(Activity.t(), keyword()) :: {:ok, [Notification.t()] | []}
   def create_notifications(activity, options \\ [])
 
   def create_notifications(%Activity{data: %{"to" => _, "type" => "Create"}} = activity, options) do
@@ -496,6 +497,10 @@ defmodule Pleroma.Notification do
     end
   end
 
+  def get_potential_receiver_ap_ids(%{data: %{"type" => "Follow", "object" => object_id}}) do
+    [object_id]
+  end
+
   def get_potential_receiver_ap_ids(activity) do
     []
     |> Utils.maybe_notify_to_recipients(activity)
@@ -640,6 +645,8 @@ defmodule Pleroma.Notification do
     end)
   end
 
+  def skip?(:filtered, %{data: %{"type" => type}}, _) when type in ["Follow", "Move"], do: false
+
   def skip?(:filtered, activity, user) do
     object = Object.normalize(activity)