未実装のTLのRenoteクエリを実装 (#5343)

* users/notes includeMyRenotes

* other renotes

* fix target user in users/notes

* users/notesからv10から未実装でありえないオプションを削除

* users/notesのincludeMyRenotesの説明を修正

* remove needless anonymous checks
This commit is contained in:
MeiMei
2019-08-27 03:24:35 +09:00
committed by syuilo
parent ba93bf7478
commit ab6a84cd45
4 changed files with 74 additions and 167 deletions

View File

@@ -74,23 +74,7 @@ export const meta = {
validator: $.optional.bool,
default: true,
desc: {
'ja-JP': '自分の行ったRenoteを含めるかどうか'
}
},
includeRenotedMyNotes: {
validator: $.optional.bool,
default: true,
desc: {
'ja-JP': 'Renoteされた自分の投稿を含めるかどうか'
}
},
includeLocalRenotes: {
validator: $.optional.bool,
default: true,
desc: {
'ja-JP': 'Renoteされたローカルの投稿を含めるかどうか'
'ja-JP': 'Renoteを含めるかどうか'
}
},
@@ -177,23 +161,15 @@ export default define(meta, async (ps, me) => {
query.andWhere('note.replyId IS NULL');
}
/* TODO
if (ps.includeMyRenotes === false) {
query.$and.push({
$or: [{
userId: { $ne: user.id }
}, {
renoteId: null
}, {
text: { $ne: null }
}, {
fileIds: { $ne: [] }
}, {
poll: { $ne: null }
}]
});
query.andWhere(new Brackets(qb => {
qb.orWhere('note.userId != :userId', { userId: user.id });
qb.orWhere('note.renoteId IS NULL');
qb.orWhere('note.text IS NOT NULL');
qb.orWhere('note.fileIds != \'{}\'');
qb.orWhere('0 < (SELECT COUNT(*) FROM poll WHERE poll."noteId" = note.id)');
}));
}
*/
//#endregion