forked from AkkomaGang/akkoma
it works!!
This commit is contained in:
parent
4430a0ad12
commit
a0d732ec55
3 changed files with 40 additions and 15 deletions
|
|
@ -6,6 +6,7 @@ defmodule Pleroma.Notification do
|
|||
use Ecto.Schema
|
||||
alias Pleroma.{User, Activity, Notification, Repo}
|
||||
alias Pleroma.Web.CommonAPI.Utils
|
||||
alias Pleroma.Web.ThreadMute
|
||||
import Ecto.Query
|
||||
|
||||
schema "notifications" do
|
||||
|
|
@ -112,6 +113,7 @@ defmodule Pleroma.Notification do
|
|||
# TODO move to sql, too.
|
||||
def create_notification(%Activity{} = activity, %User{} = user) do
|
||||
unless User.blocks?(user, %{ap_id: activity.data["actor"]}) or
|
||||
ThreadMute.muted?(user, activity) or
|
||||
user.ap_id == activity.data["actor"] or
|
||||
(activity.data["type"] == "Follow" and
|
||||
Enum.any?(Notification.for_user(user), fn notif ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue