prepareStatus: created_at_parsed.

This commit is contained in:
Roger Braun 2016-11-13 22:54:49 +01:00
parent 59647798b9
commit aeb8868b82
2 changed files with 13 additions and 0 deletions

View file

@ -115,11 +115,15 @@ export const findMaxId = (...args) => {
}
export const prepareStatus = (status) => {
// Parse nsfw tags
if (status.nsfw === undefined) {
const nsfwRegex = /#nsfw/i
status.nsfw = !!status.text.match(nsfwRegex)
}
// Set created_at_parsed to initial value
status.created_at_parsed = status.created_at
return status
}