Merge branch 'worker-messages' into 'develop'
[akkoma] / lib / pleroma / notification.ex
index 04ee510b9f13fa7d346064988dacaea2d95babc1..73e19bf970cb3edc5c10fd36fc9e08dbcc059b57 100644 (file)
@@ -284,8 +284,17 @@ defmodule Pleroma.Notification do
     end
   end
 
+  def create_notifications(%Activity{data: %{"type" => "Follow"}} = activity) do
+    if Pleroma.Config.get([:notifications, :enable_follow_request_notifications]) ||
+         Activity.follow_accepted?(activity) do
+      do_create_notifications(activity)
+    else
+      {:ok, []}
+    end
+  end
+
   def create_notifications(%Activity{data: %{"type" => type}} = activity)
-      when type in ["Like", "Announce", "Follow", "Move", "EmojiReact"] do
+      when type in ["Like", "Announce", "Move", "EmojiReact"] do
     do_create_notifications(activity)
   end