diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-01-31 20:42:45 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-01-31 20:42:45 +0900 |
| commit | a6e7bbc306a93bd56bb1941e29d6fc474c9c36d5 (patch) | |
| tree | 4ec964d4d2efc3b1c5ec82c097c6d3667c17c30f /src/server/api/endpoints/i | |
| parent | Update @types/koa-router requirement from 7.0.38 to 7.0.39 (#4052) (diff) | |
| download | sharkey-a6e7bbc306a93bd56bb1941e29d6fc474c9c36d5.tar.gz sharkey-a6e7bbc306a93bd56bb1941e29d6fc474c9c36d5.tar.bz2 sharkey-a6e7bbc306a93bd56bb1941e29d6fc474c9c36d5.zip | |
send/receive user hashtags via AP (#4064)
Diffstat (limited to 'src/server/api/endpoints/i')
| -rw-r--r-- | src/server/api/endpoints/i/update.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index b47e29c5ad..4b02e393bf 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -8,6 +8,7 @@ import define from '../../define'; import getDriveFileUrl from '../../../../misc/get-drive-file-url'; import { parse, parsePlain } from '../../../../mfm/parse'; import extractEmojis from '../../../../misc/extract-emojis'; +import extractHashtags from '../../../../misc/extract-hashtags'; const langmap = require('langmap'); export const meta = { @@ -201,9 +202,10 @@ export default define(meta, (ps, user, app) => new Promise(async (res, rej) => { } } - //#region emojis + //#region emojis/tags if (updates.name != null || updates.description != null) { let emojis = [] as string[]; + let tags = [] as string[]; if (updates.name != null) { const tokens = parsePlain(updates.name); @@ -213,9 +215,11 @@ export default define(meta, (ps, user, app) => new Promise(async (res, rej) => { if (updates.description != null) { const tokens = parse(updates.description); emojis = emojis.concat(extractEmojis(tokens)); + tags = extractHashtags(tokens); } updates.emojis = emojis; + updates.tags = tags; } //#endregion |