enhance: タグ検索においてローカルのみやファイル付きを指定できるように (MisskeyIO#527)

cheery-picked from TeamNijimiss/misskey@4fe36c8eb9

Co-authored-by: Nafu Satsuki <satsuki@nafusoft.dev>
This commit is contained in:
まっちゃとーにゅ 2024-03-16 17:37:58 +09:00 committed by GitHub
parent 5c019eec04
commit c2e1f60943
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 51 additions and 3 deletions

View file

@ -30,6 +30,7 @@ export const meta = {
export const paramDef = {
type: 'object',
properties: {
local: { type: 'boolean', nullable: true, default: null },
reply: { type: 'boolean', nullable: true, default: null },
renote: { type: 'boolean', nullable: true, default: null },
withFiles: {
@ -105,6 +106,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw e;
}
if (ps.local != null) {
if (ps.local) {
query.andWhere('user.host IS NULL');
} else {
query.andWhere('user.host IS NOT NULL');
}
}
if (ps.reply != null) {
if (ps.reply) {
query.andWhere('note.replyId IS NOT NULL');