Store texts as HTML

This commit is contained in:
Akihiko Odaki 2018-03-31 19:53:30 +09:00
parent 8c41432907
commit 7da60a0147
31 changed files with 318 additions and 283 deletions

View file

@ -11,6 +11,8 @@ import DriveFile from '../../../../../models/drive-file';
import { pack } from '../../../../../models/messaging-message';
import publishUserStream from '../../../event';
import { publishMessagingStream, publishMessagingIndexStream, pushSw } from '../../../event';
import html from '../../../../../common/text/html';
import parse from '../../../../../common/text/parse';
import config from '../../../../../conf';
/**
@ -74,6 +76,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
fileId: file ? file._id : undefined,
recipientId: recipient._id,
text: text ? text : undefined,
textHtml: text ? html(parse(text)) : undefined,
userId: user._id,
isRead: false
});