diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-11-02 22:08:22 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-11-02 22:08:22 +0100 |
commit | 632da6c9273b55984bdd67b8a10672733df7fae5 (patch) | |
tree | 60a1516f09af794f2295bbb0f539a3aeaad38207 /lib | |
parent | 6a5f0871745316b50742ea9ebf3ff7c69881e105 (diff) | |
download | pleroma-632da6c9273b55984bdd67b8a10672733df7fae5.tar.gz |
Don't create notifications if the user is blocked.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/notification.ex | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 35f817d1d..00a382f31 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -46,9 +46,11 @@ defmodule Pleroma.Notification do # TODO move to sql, too. def create_notification(%Activity{} = activity, %User{} = user) do - notification = %Notification{user_id: user.id, activity_id: activity.id} - {:ok, notification} = Repo.insert(notification) - notification + unless User.blocks?(user, %{ap_id: activity.data["actor"]}) do + notification = %Notification{user_id: user.id, activity_id: activity.id} + {:ok, notification} = Repo.insert(notification) + notification + end end end |