diff options
author | Sergey Suprunenko <suprunenko.s@gmail.com> | 2020-08-17 00:07:23 +0200 |
---|---|---|
committer | Sergey Suprunenko <suprunenko.s@gmail.com> | 2020-08-17 00:11:33 +0200 |
commit | 25c69e271a3ea6687805e0bd0d4b902cda06e364 (patch) | |
tree | 741282e22dfcb5cdcf1603fd1718db02574d2384 /lib | |
parent | 0865f36965f1583085af3a424dbbc89de724fd33 (diff) | |
download | pleroma-25c69e271a3ea6687805e0bd0d4b902cda06e364.tar.gz |
Make notifications about new statuses from muted threads read
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/notification.ex | 3 | ||||
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index b4719896e..c1825f810 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -15,6 +15,7 @@ defmodule Pleroma.Notification do alias Pleroma.Repo alias Pleroma.ThreadMute alias Pleroma.User + alias Pleroma.Web.CommonAPI alias Pleroma.Web.CommonAPI.Utils alias Pleroma.Web.Push alias Pleroma.Web.Streamer @@ -637,7 +638,7 @@ defmodule Pleroma.Notification do def mark_as_read?(activity, target_user) do user = Activity.user_actor(activity) - User.mutes_user?(target_user, user) + User.mutes_user?(target_user, user) || CommonAPI.thread_muted?(target_user, activity) end def for_user_and_activity(user, activity) do diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index a8141b28f..5ad2b91c2 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -465,7 +465,7 @@ defmodule Pleroma.Web.CommonAPI do end def thread_muted?(%User{id: user_id}, %{data: %{"context" => context}}) - when is_binary("context") do + when is_binary(context) do ThreadMute.exists?(user_id, context) end |