<commit_before>require! {
	'../../../models/talk-message': TalkMessage
	'../../auth': authorize
}
module.exports = (req, res) -> authorize req, res, (user, app) ->
	msg-id = req.body.message_id
	switch
	| !msg-id? => res.api-error 400 'message_id parameter is required :('
	| _ => TalkMessage.find msg-id, (msg) ->
		| !msg? => res.api-error 400 'Message not found.'
		| msg.otherparty-id != user.id => res.api-error 400 'Send Message opponent can only be to read.'
		| _ =>
			msg
				..is-read = true
				..update -> TalkMessage.build-response-object msg, res.api-render<commit_msg>Improve readability<commit_after>require! {
	'../../../models/talk-message': TalkMessage
	'../../auth': authorize
}
module.exports = (req, res) -> authorize req, res, (user, app) ->
	msg-id = req.body.message-id
	switch
	| !msg-id? => res.api-error 400 'messageId parameter is required :('
	| _ => TalkMessage.find msg-id, (msg) ->
		| !msg? => res.api-error 400 'Message not found.'
		| msg.otherparty-id != user.id => res.api-error 400 'Send Message opponent can only be to read.'
		| _ =>
			msg
				..is-read = true
				..update -> TalkMessage.build-response-object msg, res.api-render
{'fraction_non_alphanumeric': 0.1867007672634271, 'fraction_numerical': 0.015345268542199489, 'mean_word_length': 3.006825938566553, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '6479808', 'n_tokens_mistral': 440, 'n_tokens_neox': 394, 'n_words': 102}