Store texts as HTML
This commit is contained in:
@ -3,7 +3,6 @@ import deepcopy = require('deepcopy');
|
||||
import { pack as packUser } from './user';
|
||||
import { pack as packFile } from './drive-file';
|
||||
import db from '../db/mongodb';
|
||||
import parse from '../common/text';
|
||||
|
||||
const MessagingMessage = db.get<IMessagingMessage>('messagingMessages');
|
||||
export default MessagingMessage;
|
||||
@ -12,6 +11,7 @@ export interface IMessagingMessage {
|
||||
_id: mongo.ObjectID;
|
||||
createdAt: Date;
|
||||
text: string;
|
||||
textHtml: string;
|
||||
userId: mongo.ObjectID;
|
||||
recipientId: mongo.ObjectID;
|
||||
isRead: boolean;
|
||||
@ -60,11 +60,6 @@ export const pack = (
|
||||
_message.id = _message._id;
|
||||
delete _message._id;
|
||||
|
||||
// Parse text
|
||||
if (_message.text) {
|
||||
_message.ast = parse(_message.text);
|
||||
}
|
||||
|
||||
// Populate user
|
||||
_message.user = await packUser(_message.userId, me);
|
||||
|
||||
|
@ -8,7 +8,6 @@ import { pack as packChannel } from './channel';
|
||||
import Vote from './poll-vote';
|
||||
import Reaction from './post-reaction';
|
||||
import { pack as packFile } from './drive-file';
|
||||
import parse from '../common/text';
|
||||
|
||||
const Post = db.get<IPost>('posts');
|
||||
|
||||
@ -31,6 +30,7 @@ export type IPost = {
|
||||
repostId: mongo.ObjectID;
|
||||
poll: any; // todo
|
||||
text: string;
|
||||
textHtml: string;
|
||||
cw: string;
|
||||
userId: mongo.ObjectID;
|
||||
appId: mongo.ObjectID;
|
||||
@ -103,11 +103,6 @@ export const pack = async (
|
||||
delete _post.mentions;
|
||||
if (_post.geo) delete _post.geo.type;
|
||||
|
||||
// Parse text
|
||||
if (_post.text) {
|
||||
_post.ast = parse(_post.text);
|
||||
}
|
||||
|
||||
// Populate user
|
||||
_post.user = packUser(_post.userId, meId);
|
||||
|
||||
|
Reference in New Issue
Block a user