diff --git a/lib/philomena_web/controllers/image/comment_controller.ex b/lib/philomena_web/controllers/image/comment_controller.ex index 485a94fa..1c97ad1f 100644 --- a/lib/philomena_web/controllers/image/comment_controller.ex +++ b/lib/philomena_web/controllers/image/comment_controller.ex @@ -112,6 +112,10 @@ defmodule PhilomenaWeb.Image.CommentController do def update(conn, %{"comment" => comment_params}) do case Comments.update_comment(conn.assigns.comment, conn.assigns.current_user, comment_params) do {:ok, %{comment: comment}} -> + if not comment.approved do + Comments.report_non_approved(comment) + end + PhilomenaWeb.Endpoint.broadcast!( "firehose", "comment:update", diff --git a/lib/philomena_web/controllers/topic/post_controller.ex b/lib/philomena_web/controllers/topic/post_controller.ex index 98d62698..342ceddd 100644 --- a/lib/philomena_web/controllers/topic/post_controller.ex +++ b/lib/philomena_web/controllers/topic/post_controller.ex @@ -79,7 +79,11 @@ defmodule PhilomenaWeb.Topic.PostController do user = conn.assigns.current_user case Posts.update_post(post, user, post_params) do - {:ok, _post} -> + {:ok, post} -> + if not post.approved do + Posts.report_non_approved(post) + end + conn |> put_flash(:info, "Post successfully edited.") |> redirect(