From a1a3ee44b5c9a3254a33a1948aa79df6dd4dbb0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Mon, 5 Nov 2018 10:45:57 +0900 Subject: [PATCH] Implement /api/v1/custom_emojis (#3116) --- src/server/api/mastodon.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/api/mastodon.ts b/src/server/api/mastodon.ts index a5b59e2e0f..33a0b4b5f1 100644 --- a/src/server/api/mastodon.ts +++ b/src/server/api/mastodon.ts @@ -4,12 +4,18 @@ import { toASCII } from 'punycode'; import config from '../../config'; import Meta from '../../models/meta'; import { ObjectID } from 'bson'; +import Emoji from '../../models/emoji'; const pkg = require('../../../package.json'); // Init router const router = new Router(); -router.get('/v1/custom_emojis', async ctx => ctx.body = {}); +router.get('/v1/custom_emojis', async ctx => ctx.body = + await Emoji.find({ host: null }, { + fields: { + _id: false + } + })); router.get('/v1/instance', async ctx => { // TODO: This is a temporary implementation. Consider creating helper methods! const meta = await Meta.findOne() || {};