X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fnotification.ex;h=a40b8f8c936a6844afba2773763a61864cc538ff;hb=94d8f1ab305b513931b81d7a4b3e41e30b688a16;hp=ca4113d315f7df9ac353486080b8c1d46a47d477;hpb=cdfdd77e30eb7d83b68d932148cc24a3fbcd5967;p=akkoma diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index ca4113d31..a40b8f8c9 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -110,13 +110,16 @@ defmodule Pleroma.Notification do notification = %Notification{user_id: user.id, activity: activity} {:ok, notification} = Repo.insert(notification) Pleroma.Web.Streamer.stream("user", notification) + Pleroma.Web.Push.send(notification) notification end end + def get_notified_from_activity(activity, local_only \\ true) + def get_notified_from_activity( %Activity{data: %{"to" => _, "type" => type} = data} = activity, - local_only \\ true + local_only ) when type in ["Create", "Like", "Announce", "Follow"] do recipients = @@ -128,6 +131,8 @@ defmodule Pleroma.Notification do User.get_users_from_set(recipients, local_only) end + def get_notified_from_activity(_, local_only), do: [] + defp maybe_notify_to_recipients( recipients, %Activity{data: %{"to" => to, "type" => type}} = activity