From b1bfda0e11e1af1534381ab6e6a74dab9f524b56 Mon Sep 17 00:00:00 2001 From: Robin Ward <robin.ward@gmail.com> Date: Wed, 15 May 2013 15:16:42 -0400 Subject: [PATCH] Don't show new user education when editing a reply. --- .../javascripts/discourse/controllers/composer_controller.js | 4 ++++ lib/post_creator.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/app/assets/javascripts/discourse/controllers/composer_controller.js b/app/assets/javascripts/discourse/controllers/composer_controller.js index e25420d02..f209d5cc8 100644 --- a/app/assets/javascripts/discourse/controllers/composer_controller.js +++ b/app/assets/javascripts/discourse/controllers/composer_controller.js @@ -116,6 +116,10 @@ Discourse.ComposerController = Discourse.Controller.extend({ }.property('content.composeState', 'content.reply', 'educationClosed', 'educationContents'), fetchNewUserEducation: function() { + + // We don't show education when editing a post. + if (this.get('content.editingPost')) return; + // If creating a topic, use topic_count, otherwise post_count var count = this.get('content.creatingTopic') ? Discourse.get('currentUser.topic_count') : Discourse.get('currentUser.reply_count'); if (count >= Discourse.SiteSettings.educate_until_posts) { diff --git a/lib/post_creator.rb b/lib/post_creator.rb index 6f88b332d..a93a14b49 100644 --- a/lib/post_creator.rb +++ b/lib/post_creator.rb @@ -121,6 +121,7 @@ class PostCreator # Track the topic TopicUser.auto_track(@user.id, topic.id, TopicUser.notification_reasons[:created_post]) + # We don't count replies to your own topics if @user.id != topic.user_id @user.update_topic_reply_count end