ハッシュタグでユーザー検索できるように (#4298)
* ハッシュタグでユーザー検索できるように
* 🎨
* Increase limit
* リモートユーザーも表示
* Fix bug
* Fix bug
* Improve performance
This commit is contained in:
@ -23,6 +23,7 @@ import Following from '../../../models/following';
|
||||
import { IIdentifier } from './identifier';
|
||||
import { apLogger } from '../logger';
|
||||
import { INote } from '../../../models/note';
|
||||
import { updateHashtag } from '../../../services/update-hashtag';
|
||||
const logger = apLogger;
|
||||
|
||||
/**
|
||||
@ -210,6 +211,10 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<IU
|
||||
usersChart.update(user, true);
|
||||
//#endregion
|
||||
|
||||
// ハッシュタグ登録
|
||||
for (const tag of tags) updateHashtag(user, tag, true, true);
|
||||
for (const tag of (user.tags || []).filter(x => !tags.includes(x))) updateHashtag(user, tag, true, false);
|
||||
|
||||
//#region アイコンとヘッダー画像をフェッチ
|
||||
const [avatar, banner] = (await Promise.all<IDriveFile>([
|
||||
person.icon,
|
||||
@ -383,6 +388,10 @@ export async function updatePerson(uri: string, resolver?: Resolver, hint?: obje
|
||||
$set: updates
|
||||
});
|
||||
|
||||
// ハッシュタグ更新
|
||||
for (const tag of tags) updateHashtag(exist, tag, true, true);
|
||||
for (const tag of (exist.tags || []).filter(x => !tags.includes(x))) updateHashtag(exist, tag, true, false);
|
||||
|
||||
// 該当ユーザーが既にフォロワーになっていた場合はFollowingもアップデートする
|
||||
await Following.update({
|
||||
followerId: exist._id
|
||||
|
Reference in New Issue
Block a user