Store texts as HTML
This commit is contained in:
@ -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
|
||||
});
|
||||
|
@ -3,7 +3,8 @@
|
||||
*/
|
||||
import $ from 'cafy';
|
||||
import deepEqual = require('deep-equal');
|
||||
import parse from '../../../../common/text';
|
||||
import html from '../../../../common/text/html';
|
||||
import parse from '../../../../common/text/parse';
|
||||
import { default as Post, IPost, isValidText, isValidCw } from '../../../../models/post';
|
||||
import { default as User, ILocalAccount, IUser } from '../../../../models/user';
|
||||
import { default as Channel, IChannel } from '../../../../models/channel';
|
||||
@ -259,6 +260,7 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => {
|
||||
repostId: repost ? repost._id : undefined,
|
||||
poll: poll,
|
||||
text: text,
|
||||
textHtml: tokens === null ? null : html(tokens),
|
||||
cw: cw,
|
||||
tags: tags,
|
||||
userId: user._id,
|
||||
|
Reference in New Issue
Block a user