From e8db63e788b62f6748bd1d09730d0f55a36bbc9a Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 18 Feb 2019 01:11:14 +0900 Subject: [PATCH] Fix bug --- CHANGELOG.md | 4 ++++ src/remote/activitypub/models/person.ts | 6 +++--- src/server/api/endpoints/i/update.ts | 2 +- src/services/note/create.ts | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f36a73395..8ee6ba0ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ ChangeLog ========= +10.87.1 +---------- +* ハッシュタグ検索で大文字小文字が区別されてしまう問題を修正 + 10.87.0 ---------- * ハッシュタグでユーザー検索できるように diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index 9a38bbf14..c2b99dfb0 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -143,7 +143,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise tag.toLowerCase()); const isBot = object.type == 'Service'; @@ -211,7 +211,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise !tags.includes(x))) updateHashtag(user, tag, true, false); @@ -343,7 +343,7 @@ export async function updatePerson(uri: string, resolver?: Resolver, hint?: obje const { fields, services } = analyzeAttachments(person.attachment); - const tags = extractHashtags(person.tag); + const tags = extractHashtags(person.tag).map(tag => tag.toLowerCase()); const updates = { lastFetchedAt: new Date(), diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index b3ec53223..1de7a807c 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -217,7 +217,7 @@ 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); + tags = extractHashtags(tokens).map(tag => tag.toLowerCase()); } updates.emojis = emojis; diff --git a/src/services/note/create.ts b/src/services/note/create.ts index c94686dcc..2a25df155 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -234,7 +234,7 @@ export default async (user: IUser, data: Option, silent = false) => new Promise< }); } - // ハッシュタグ登録 + // ハッシュタグ更新 for (const tag of tags) updateHashtag(user, tag); // ファイルが添付されていた場合ドライブのファイルの「このファイルが添付された投稿一覧」プロパティにこの投稿を追加