FEATURE: proper mailing list mode

once enable_mailing_list_mode is enabled any user can elect
to get every post via email unless they opt out of category or topic
This commit is contained in:
Sam
2014-02-07 11:06:35 +11:00
parent 3a1c5ed39d
commit 227873df78
23 changed files with 134 additions and 68 deletions

View File

@@ -135,8 +135,17 @@ class PostCreator
end
def after_post_create
if !@topic.private_message? && @post.post_number > 1 && @post.post_type != Post.types[:moderator_action]
TopicTrackingState.publish_unread(@post)
if !@topic.private_message? && @post.post_type != Post.types[:moderator_action]
if @post.post_number > 1
TopicTrackingState.publish_unread(@post)
end
if SiteSetting.enable_mailing_list_mode
Jobs.enqueue_in(
SiteSetting.email_time_window_mins.minutes,
:notify_mailing_list_subscribers,
post_id: @post.id
)
end
end
end

View File

@@ -39,7 +39,6 @@ class TopicCreator
@topic.notifier.watch_topic!(id, nil)
end
TopicUser.auto_watch_new_topic(@topic.id)
CategoryUser.auto_watch_new_topic(@topic)
end