diff options
author | eugenijm <eugenijm@protonmail.com> | 2019-10-25 21:29:23 +0300 |
---|---|---|
committer | eugenijm <eugenijm@protonmail.com> | 2019-10-26 02:29:18 +0300 |
commit | 058065448510af59f550ec7d7f99b81388bc7a40 (patch) | |
tree | ebfab2d6e509637607f8c42839abd1c15c0bc5d6 /lib/pleroma/user.ex | |
parent | 653054d301b88070cd60f6b0f8a0b188dee81cba (diff) | |
download | pleroma-058065448510af59f550ec7d7f99b81388bc7a40.tar.gz |
Mark the conversations with the blocked user as read and update the blocking user's `unread_conversation_count`.
Since the conversations with the blocked user are invisible, they are excluded
from the blocking user's `unread_conversation_count`.
Diffstat (limited to 'lib/pleroma/user.ex')
-rw-r--r-- | lib/pleroma/user.ex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index b99e236a4..5d3f55721 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -971,7 +971,7 @@ defmodule Pleroma.User do end end - def set_unread_conversation_count(_), do: :noop + def set_unread_conversation_count(user), do: {:ok, user} def increment_unread_conversation_count(conversation, %User{local: true} = user) do unread_query = @@ -993,7 +993,7 @@ defmodule Pleroma.User do end end - def increment_unread_conversation_count(_, _), do: :noop + def increment_unread_conversation_count(_, user), do: {:ok, user} def remove_duplicated_following(%User{following: following} = user) do uniq_following = Enum.uniq(following) @@ -1077,7 +1077,7 @@ defmodule Pleroma.User do if following?(blocked, blocker), do: unfollow(blocked, blocker) {:ok, blocker} = update_follower_count(blocker) - + {:ok, blocker, _} = Participation.mark_all_as_read(blocker, blocked) add_to_block(blocker, ap_id) end |