dmails: allow marking dmails as unread.
* Add ability to mark dmails as unread. * Fix users.unread_dmail_count to not count deleted dmails. * Fix show action so that API calls don't mark dmails as read. * Don't show the unread dmail notice on the /dmails page itself. * Stop using users.has_mail flag.
This commit is contained in:
@@ -35,6 +35,7 @@ class User < ApplicationRecord
|
||||
# - has_saved_searches
|
||||
# - opt_out_tracking
|
||||
# - enable_recommended_posts
|
||||
# - has_mail
|
||||
BOOLEAN_ATTRIBUTES = %w(
|
||||
is_banned
|
||||
has_mail
|
||||
@@ -798,14 +799,6 @@ class User < ApplicationRecord
|
||||
CurrentUser.as(self, &block)
|
||||
end
|
||||
|
||||
def dmail_count
|
||||
if has_mail?
|
||||
"(#{unread_dmail_count})"
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
def reportable_by?(user)
|
||||
ModerationReport.enabled? && user.is_builder? && id != user.id && !is_moderator?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user