FEATURE: min_first_post_typing_time

If a user spends less than 3 seconds typing
first post they will automatically enter the approval queue
This commit is contained in:
Sam
2015-08-04 10:55:59 +10:00
parent a2533e2a02
commit 01ad88f1ed
5 changed files with 33 additions and 4 deletions

View File

@ -89,6 +89,8 @@ class PostsController < ApplicationController
def create
@manager_params = create_params
@manager_params[:first_post_checks] = !is_api?
manager = NewPostManager.new(current_user, @manager_params)
if is_api?
@ -353,7 +355,7 @@ class PostsController < ApplicationController
# If a param is present it uses that result structure.
def backwards_compatible_json(json_obj, success)
json_obj.symbolize_keys!
if params[:nested_post].blank? && json_obj[:errors].blank?
if params[:nested_post].blank? && json_obj[:errors].blank? && json_obj[:action] != :enqueued
json_obj = json_obj[:post]
end