From 80b5fda292efd70cc749910e3672d50c9a70a72e Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 2 Nov 2018 08:59:40 +0900 Subject: Remote custom emojis (#3074) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remote custom emojis * んほおおおおお --- src/remote/activitypub/misc/get-emoji-names.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/remote/activitypub/misc/get-emoji-names.ts (limited to 'src/remote/activitypub/misc') diff --git a/src/remote/activitypub/misc/get-emoji-names.ts b/src/remote/activitypub/misc/get-emoji-names.ts new file mode 100644 index 0000000000..f744d02fed --- /dev/null +++ b/src/remote/activitypub/misc/get-emoji-names.ts @@ -0,0 +1,6 @@ +import parse from '../../../mfm/parse'; + +export default function(text: string) { + if (!text) return []; + return parse(text).filter(t => t.type === 'emoji').map(t => (t as any).emoji); +} -- cgit v1.2.3-freya