mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
omit likes if notify likes is set to never
This commit is contained in:
parent
af577a5854
commit
332e05b73d
1 changed files with 8 additions and 1 deletions
|
@ -122,12 +122,19 @@ class Notification < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.recent_report(user, count = nil)
|
||||
return unless user && user.user_option
|
||||
|
||||
count ||= 10
|
||||
notifications = user.notifications
|
||||
.visible
|
||||
.recent(count)
|
||||
.includes(:topic)
|
||||
.to_a
|
||||
|
||||
if user.user_option.like_notification_frequency == UserOption.like_notification_frequency_type[:never]
|
||||
notifications = notifications.where('notification_type <> ?', Notification.types[:liked])
|
||||
end
|
||||
|
||||
notifications = notifications.to_a
|
||||
|
||||
if notifications.present?
|
||||
|
||||
|
|
Loading…
Reference in a new issue