Make notifications about new statuses from muted threads read

This commit is contained in:
Sergey Suprunenko 2020-08-17 00:07:23 +02:00
commit 25c69e271a
No known key found for this signature in database
GPG key ID: 5DCA7D1BE3914F9C
4 changed files with 10 additions and 3 deletions

View file

@ -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

View file

@ -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