Skip to content

Commit c716972

Browse files
committed
Remove special case notifying author of threads
Instead of special casing creating a notification, we just have them follow normally automatically.
1 parent dd905a7 commit c716972

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

app/controllers/comments_controller.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,9 @@ def create_thread
4141

4242
if success
4343
notification = "New comment thread on #{@comment.root.title}: #{@comment_thread.title}"
44-
unless @comment.post.user == current_user
45-
@comment.post.user.create_notification(notification, helpers.comment_link(@comment))
46-
end
4744

4845
ThreadFollower.where(post: @post).each do |tf|
49-
unless tf.user == current_user || tf.user == @comment.post.user
46+
unless tf.user == current_user
5047
tf.user.create_notification(notification, helpers.comment_link(@comment))
5148
end
5249
ThreadFollower.create(user: tf.user, comment_thread: @comment_thread)

app/controllers/posts_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def create
100100

101101
if @post.save
102102
@post.update(last_activity: @post.created_at, last_activity_by: current_user)
103+
ThreadFollower.create user: @post.user, post: @post
103104
if @post_type.has_parent?
104105
unless @post.user_id == @post.parent.user_id
105106
@post.parent.user.create_notification("New response to your post #{@post.parent.title}",

0 commit comments

Comments
 (0)