mirror of
https://github.com/discourse/discourse.git
synced 2025-02-19 04:02:46 +08:00
use notification_levels methods for specifying normal notification level
This commit is contained in:
parent
8090e2844c
commit
5fa5c18a48
|
@ -39,8 +39,9 @@ class TopicUser < ActiveRecord::Base
|
|||
|
||||
def auto_notification(user_id, topic_id, reason, notification_level)
|
||||
if TopicUser.where("user_id = :user_id AND topic_id = :topic_id AND (notifications_reason_id IS NULL OR
|
||||
(notification_level < :notification_level AND notification_level > 1))",
|
||||
user_id: user_id, topic_id: topic_id, notification_level: notification_level).exists?
|
||||
(notification_level < :notification_level AND notification_level > :normal_notification_level))",
|
||||
user_id: user_id, topic_id: topic_id, notification_level: notification_level,
|
||||
normal_notification_level: notification_levels[:regular]).exists?
|
||||
change(user_id, topic_id,
|
||||
notification_level: notification_level,
|
||||
notifications_reason_id: reason
|
||||
|
|
Loading…
Reference in New Issue
Block a user