<commit_before>import marked from 'marked'
import moment from 'moment-timezone'

import {
  DEFAULT_LIMIT,
  DEFAULT_OFFSET,
  prepareAnimalResponse,
} from './base'

import db from '../database'
import pick from '../utils/pick'

import ConversationAnimal from '../models/conversationAnimal'
import Message from '../models/message'
import { addMessageActivity } from '../services/activity'
import { MessageBelongsToAnimal } from '../database/associations'

const permittedFields = [
  'text',
]

function prepareResponse(message, req) {
  const response = message.toJSON()
  const animalMe = req.meAnimal

  response.isWrittenByMe = (
    animalMe.userId === req.user.id &&
    animalMe.id === message.animal.id
  )

  const lastCheckedAt = animalMe.conversationsAnimals.updatedAt
  if (response.animal.id === animalMe.id) {
    response.isRead = true
  } else {
    response.isRead = moment(lastCheckedAt).isAfter(response.createdAt)
  }

  response.textHtml = marked(response.text)
<commit_msg>Add missing getConfig import<commit_after>import marked from 'marked'
import moment from 'moment-timezone'

import {
  DEFAULT_LIMIT,
  DEFAULT_OFFSET,
  prepareAnimalResponse,
} from './base'

import db from '../database'
import pick from '../utils/pick'

import ConversationAnimal from '../models/conversationAnimal'
import Message from '../models/message'
import { MessageBelongsToAnimal } from '../database/associations'
import { addMessageActivity } from '../services/activity'
import { getConfig } from '../config'

const permittedFields = [
  'text',
]

function prepareResponse(message, req) {
  const response = message.toJSON()
  const animalMe = req.meAnimal

  response.isWrittenByMe = (
    animalMe.userId === req.user.id &&
    animalMe.id === message.animal.id
  )

  const lastCheckedAt = animalMe.conversationsAnimals.updatedAt
  if (response.animal.id === animalMe.id) {
    response.isRead = true
  } else {
    response.isRead = moment(lastCheckedAt).isAfter(response.createdAt)
  }

  response.textHtml = marked(response.text)

{'fraction_non_alphanumeric': 0.12078239608801956, 'fraction_numerical': 0.0, 'mean_word_length': 4.179746835443038, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2242482', 'n_tokens_mistral': 617, 'n_tokens_neox': 596, 'n_words': 143}