Skip generating notifications for internal users

This commit is contained in:
Mark Felder 2024-01-30 10:41:52 -05:00
parent 291d531e4c
commit c25fda34e7
2 changed files with 9 additions and 9 deletions

View File

@ -630,6 +630,7 @@ defmodule Pleroma.Notification do
def skip?(%Activity{} = activity, %User{} = user, opts) do
[
:self,
:internal,
:invisible,
:block_from_strangers,
:recently_followed,
@ -649,6 +650,12 @@ defmodule Pleroma.Notification do
end
end
def skip?(:internal, %Activity{} = activity, _user, _opts) do
actor = activity.data["actor"]
user = User.get_cached_by_ap_id(actor)
User.internal?(user)
end
def skip?(:invisible, %Activity{} = activity, _user, _opts) do
actor = activity.data["actor"]
user = User.get_cached_by_ap_id(actor)

View File

@ -261,16 +261,9 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
Utils.add_announce_to_object(object, announced_object)
notifications =
if !User.is_internal_user?(user) do
{:ok, notifications} = Notification.create_notifications(object)
{:ok, notifications} = Notification.create_notifications(object)
ap_streamer().stream_out(object)
notifications
else
[]
end
if !User.internal?(user), do: ap_streamer().stream_out(object)
meta =
meta