<commit_before>require! {
	fs
	jade
	'../../../internal/create-status'
	'../../../auth': authorize
	'../../../../utils/get-express-params'
	'../../../../web/main/utils/serialize-timeline-status'
	'../../../../web/main/utils/parse-text'
	'../../../../config'
}

module.exports = (req, res) -> authorize req, res, (user, app) ->
	[text, in-reply-to-status-id] = get-express-params do
		req, <[ text in-reply-to-status-id ]>
	
	if empty in-reply-to-status-id then in-reply-to-status-id = null
	
	image = null
	if (Object.keys req.files).length == 1 =>
		path = req.files.image.path
		image = fs.read-file-sync path
	
	create-status do
		app, user, text, in-reply-to-status-id, image
	.then do
		(status) ->
			status-compiler = jade.compile-file "#__dirname/../../web/main/views/dynamic-parts/status/status-reply.jade"
			serialize-timeline-status status, user, (serialized-status) ->
				res.api-render status-compiler do<commit_msg>Fix bug<commit_after>require! {
	fs
	jade
	'../../../internal/create-status'
	'../../../auth': authorize
	'../../../../utils/get-express-params'
	'../../../../web/main/utils/serialize-timeline-status'
	'../../../../web/main/utils/parse-text'
	'../../../../config'
}

module.exports = (req, res) -> authorize req, res, (user, app) ->
	[text, in-reply-to-status-id] = get-express-params do
		req, <[ text in-reply-to-status-id ]>
	
	if empty in-reply-to-status-id then in-reply-to-status-id = null
	
	image = null
	if (Object.keys req.files).length == 1 =>
		path = req.files.image.path
		image = fs.read-file-sync path
	
	create-status do
		app, user, text, in-reply-to-status-id, image
	.then do
		(status) ->
			status-compiler = jade.compile-file "#__dirname/../../../../web/main/views/dynamic-parts/status/status-reply.jade"
			serialize-timeline-status status, user, (serialized-status) ->
				res.api-render status-compiler do
{'fraction_non_alphanumeric': 0.22556390977443608, 'fraction_numerical': 0.0010741138560687433, 'mean_word_length': 2.5150943396226415, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4916890', 'n_tokens_mistral': 695, 'n_tokens_neox': 652, 'n_words': 124}