FIX: Fixed editing whispers bumps topic (#7106)

FIX: Fixed editing whispers bumps topic (#7106)

diff --git a/lib/post_revisor.rb b/lib/post_revisor.rb
index defefe9..e3c2407 100644
--- a/lib/post_revisor.rb
+++ b/lib/post_revisor.rb
@@ -512,7 +512,7 @@ class PostRevisor
   end
 
   def bypass_bump?
-    !@post_successfully_saved || @topic_changes.errored? || @opts[:bypass_bump] == true
+    !@post_successfully_saved || @topic_changes.errored? || @opts[:bypass_bump] == true || @post.whisper?
   end
 
   def is_last_post?
diff --git a/spec/requests/posts_controller_spec.rb b/spec/requests/posts_controller_spec.rb
index cbd62f5..6c400cd 100644
--- a/spec/requests/posts_controller_spec.rb
+++ b/spec/requests/posts_controller_spec.rb
@@ -393,6 +393,15 @@ describe PostsController do
         post.reload
         expect(post.raw).to eq('edited body')
       end
+
+      it "won't update bump date if post is a whisper" do
+        post = Fabricate(:post, post_type: Post.types[:whisper], user: user)
+
+        put "/posts/#{post.id}.json", params: update_params
+        expect(response.status).to eq(200)
+
+        expect(post.topic.reload.bumped_at).to be < post.created_at
+      end
     end
 
     it 'can not change category to a disallowed category' do

GitHub sha: 83f4c4a3

1 Like