From 4cf7895cda4d018e4e2af611054de9f35ae6c348 Mon Sep 17 00:00:00 2001 From: 17sushmita <17sushmita@gmail.com> Date: Wed, 24 Mar 2021 20:05:33 +0530 Subject: [PATCH 1/2] Hide replied comments which are spam or first time comment --- app/views/notes/_comment.html.erb | 15 +++++++++++++-- app/views/notes/_comments.html.erb | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/views/notes/_comment.html.erb b/app/views/notes/_comment.html.erb index 3e2e35a6ca..702e8fee5c 100644 --- a/app/views/notes/_comment.html.erb +++ b/app/views/notes/_comment.html.erb @@ -160,9 +160,20 @@ <% if comment.reply_to.nil? %> <% comment.replied_comments.order("timestamp ASC").each do |replied_comment| %> - <%= render :partial => "notes/comment", :locals => {:comment => replied_comment} %> + <% if logged_in_as(['admin','moderator'])%> + <% if replied_comment.status == 4 || replied_comment.status == 1 %> + <%= render :partial => "notes/comment", :locals => {:comment => replied_comment} %> + <% end %> + <% elsif current_user && current_user.id = replied_comment.author.id %> + <% if replied_comment.status == 1 || (replied_comment.status == 4 && replied_comment.uid = current_user.id) %> + <%= render :partial => "notes/comment", :locals => {:comment => replied_comment} %> + <% end %> + <% else %> + <% if replied_comment.status == 1 %> + <%= render :partial => "notes/comment", :locals => {:comment => replied_comment} %> + <% end %> + <% end %> <% end %> -

Reply to this comment...