mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 11:55:21 +08:00
FIX: broken specs after new link alerting code
This commit is contained in:
@ -48,24 +48,6 @@ class PostAlertObserver < ActiveRecord::Observer
|
||||
alerter.create_notification(post.user, Notification.types[:edited], post, display_username: post_revision.user.username)
|
||||
end
|
||||
|
||||
def after_create_post(post)
|
||||
if post.topic.private_message?
|
||||
# If it's a private message, notify the topic_allowed_users
|
||||
post.topic.all_allowed_users.reject{ |user| user.id == post.user_id }.each do |user|
|
||||
next if user.blank?
|
||||
|
||||
if TopicUser.get(post.topic, user).try(:notification_level) == TopicUser.notification_levels[:tracking]
|
||||
next unless post.reply_to_post_number
|
||||
next unless post.reply_to_post.user_id == user.id
|
||||
end
|
||||
|
||||
alerter.create_notification(user, Notification.types[:private_message], post)
|
||||
end
|
||||
elsif post.post_type != Post.types[:moderator_action]
|
||||
# If it's not a private message and it's not an automatic post caused by a moderator action, notify the users
|
||||
alerter.notify_post_users(post)
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
Reference in New Issue
Block a user