@@ -25,7 +25,7 @@ class CommentsController < ApplicationController
2525 before_action :check_lock_thread_access , only : [ :lock_thread ]
2626 before_action :check_thread_access , only : [ :thread , :thread_content , :thread_followers ]
2727 before_action :check_unrestrict_access , only : [ :thread_unrestrict ]
28- before_action :check_if_target_post_locked , only : [ :create , :post_follow ]
28+ before_action :check_if_target_post_locked , only : [ :create , :create_thread ]
2929 before_action :check_if_parent_post_locked , only : [ :update , :destroy ]
3030 before_action :verify_moderator , only : [ :thread_followers ]
3131
@@ -56,12 +56,9 @@ def create_thread
5656
5757 if success
5858 notification = "New comment thread on #{ @comment . root . title } : #{ @comment_thread . title } "
59- unless @comment . post . user . same_as? ( current_user )
60- @comment . post . user . create_notification ( notification , helpers . comment_link ( @comment ) )
61- end
6259
6360 NewThreadFollower . where ( post : @post ) . each do |ntf |
64- unless ntf . user . same_as? ( current_user ) || ntf . user . same_as? ( @comment . post . user )
61+ unless ntf . user . same_as? ( current_user )
6562 ntf . user . create_notification ( notification , helpers . comment_link ( @comment ) )
6663 end
6764 ThreadFollower . create ( user : ntf . user , comment_thread : @comment_thread )
0 commit comments