FEATURE: Introducing new UI for changing User's notification levels (#7248)

* FEATURE: Introducing new UI for tracking User's ignored or muted states
This commit is contained in:
Tarek Khalil
2019-03-27 09:41:50 +00:00
committed by GitHub
parent 675d950eab
commit ef2362a30f
16 changed files with 251 additions and 92 deletions

View File

@ -50,7 +50,9 @@ class UserSerializer < BasicUserSerializer
:can_edit_name,
:stats,
:ignored,
:muted,
:can_ignore_user,
:can_mute_user,
:can_send_private_messages,
:can_send_private_message_to_user,
:bio_excerpt,
@ -281,6 +283,14 @@ class UserSerializer < BasicUserSerializer
IgnoredUser.where(user_id: scope.user&.id, ignored_user_id: object.id).exists?
end
def muted
MutedUser.where(user_id: scope.user&.id, muted_user_id: object.id).exists?
end
def can_mute_user
scope.can_mute_user?(object.id)
end
def can_ignore_user
scope.can_ignore_user?(object.id)
end