Skip to content

Commit

Permalink
enhance: ユーザー検索やイベント検索でもindexableを尊重するように
Browse files Browse the repository at this point in the history
  • Loading branch information
Esurio committed Sep 11, 2024
1 parent 24adbc5 commit c25e82c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11797,11 +11797,11 @@ export interface Locale extends ILocale {
};
"_isIndexable": {
/**
* 公開ノートをインデックス化
* 公開インデックス化
*/
"title": string;
/**
* kmy互換機能。公開ノートをインデックス化するかどうかを設定します。
* 自身のアカウントや投稿を検索することを許可します
*/
"description": string;
};
Expand Down
4 changes: 2 additions & 2 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3149,8 +3149,8 @@ _dice:
diceFaces: "サイコロの面数"

_isIndexable:
title: "公開ノートをインデックス化"
description: "kmy互換機能。公開ノートをインデックス化するかどうかを設定します。"
title: "公開インデックス化"
description: "自身のアカウントや投稿を検索することを許可します"

_altWarning:
noAltWarning: "ファイルに代替テキストが設定されていません。"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

query
.innerJoinAndSelect(MiEvent, 'event', 'event.noteId = note.id')
.innerJoinAndSelect('note.user', 'user');
.innerJoinAndSelect('note.user', 'user', 'user.isIndexable = true');

if (ps.query && ps.query.trim() !== '') {
query.andWhere(new Brackets((qb) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/backend/src/server/api/endpoints/users/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.where('user.updatedAt IS NULL')
.orWhere('user.updatedAt > :activeThreshold', { activeThreshold: activeThreshold });
}))
.andWhere('user.isSuspended = FALSE');
.andWhere('user.isSuspended = FALSE')
.andWhere('user.isIndexable = true');

if (ps.origin === 'local') {
nameQuery.andWhere('user.host IS NULL');
Expand Down

0 comments on commit c25e82c

Please sign in to comment.