Refactoring & 設定でTwemojiを使うかどうか切り替えられるように

This commit is contained in:
syuilo
2018-11-05 19:20:35 +09:00
parent 54e9147782
commit 65961bc15b
13 changed files with 95 additions and 58 deletions

View File

@ -8,9 +8,7 @@ import Note, { INote } from '../../../models/note';
import User from '../../../models/user';
import toHtml from '../misc/get-note-html';
import parseMfm from '../../../mfm/parse';
import getEmojiNames from '../misc/get-emoji-names';
import Emoji, { IEmoji } from '../../../models/emoji';
import { unique } from '../../../prelude/array';
export default async function renderNote(note: INote, dive = true): Promise<any> {
const promisedFiles: Promise<IDriveFile[]> = note.fileIds
@ -110,8 +108,7 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
const content = toHtml(Object.assign({}, note, { text }));
const emojiNames = unique(getEmojiNames(content));
const emojis = await getEmojis(emojiNames);
const emojis = await getEmojis(note.emojis);
const apemojis = emojis.map(emoji => renderEmoji(emoji));
const tag = [