From 3abe632f0673d5be2527aa49fa63663104681e0b Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 5 Nov 2018 19:29:50 +0900 Subject: [PATCH] Clean up --- src/remote/activitypub/misc/get-emoji-names.ts | 6 ------ src/remote/activitypub/renderer/note.ts | 10 ++++------ 2 files changed, 4 insertions(+), 12 deletions(-) delete mode 100644 src/remote/activitypub/misc/get-emoji-names.ts diff --git a/src/remote/activitypub/misc/get-emoji-names.ts b/src/remote/activitypub/misc/get-emoji-names.ts deleted file mode 100644 index 7dd634a65..000000000 --- a/src/remote/activitypub/misc/get-emoji-names.ts +++ /dev/null @@ -1,6 +0,0 @@ -import parse from '../../../mfm/parse'; - -export default function(text: string) { - if (!text) return []; - return parse(text).filter(t => t.type === 'emoji' && t.name).map(t => (t as any).name); -} diff --git a/src/remote/activitypub/renderer/note.ts b/src/remote/activitypub/renderer/note.ts index b38d47130..2b834f9d2 100644 --- a/src/remote/activitypub/renderer/note.ts +++ b/src/remote/activitypub/renderer/note.ts @@ -138,12 +138,10 @@ async function getEmojis(names: string[]): Promise { if (names == null || names.length < 1) return []; const emojis = await Promise.all( - names.map(async name => { - return await Emoji.findOne({ - name, - host: null - }); - }) + names.map(name => Emoji.findOne({ + name, + host: null + })) ); return emojis.filter(emoji => emoji != null);