diff --git a/app/controllers/ajax/answer_controller.rb b/app/controllers/ajax/answer_controller.rb index 768ba97f..f15fe671 100644 --- a/app/controllers/ajax/answer_controller.rb +++ b/app/controllers/ajax/answer_controller.rb @@ -18,6 +18,13 @@ class Ajax::AnswerController < ApplicationController end else question = Question.find(params[:id]) + + unless question.user.privacy_allow_stranger_answers + @status = :privacy_stronk + @message = "This user does not want other users to answer their question." + @success = false + return + end end answer = nil diff --git a/app/views/question/show.html.haml b/app/views/question/show.html.haml index fe74986c..b259bfa5 100644 --- a/app/views/question/show.html.haml +++ b/app/views/question/show.html.haml @@ -24,7 +24,7 @@ %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @answers.current_page }} Load more - - if user_signed_in? and !current_user.answered? @question and current_user != @question.user + - if user_signed_in? and !current_user.answered? @question and current_user != @question.user and @question.user.privacy_allow_stranger_answers .panel.panel-default#q-answer-box .panel-heading %h3.panel-title This question was not in your inbox? Answer it here!