diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-08-27 03:24:35 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-08-27 03:24:35 +0900 |
| commit | ab6a84cd45a266e97feee6a268495db8c161ce88 (patch) | |
| tree | dbcbdb24b7643f06bae7c2d354ac2318a8db998e /src/server/api/endpoints/users | |
| parent | Prevent users from changing the disabled option (#5344) (diff) | |
| download | sharkey-ab6a84cd45a266e97feee6a268495db8c161ce88.tar.gz sharkey-ab6a84cd45a266e97feee6a268495db8c161ce88.tar.bz2 sharkey-ab6a84cd45a266e97feee6a268495db8c161ce88.zip | |
未実装のTLのRenoteクエリを実装 (#5343)
* users/notes includeMyRenotes
* other renotes
* fix target user in users/notes
* users/notesからv10から未実装でありえないオプションを削除
* users/notesのincludeMyRenotesの説明を修正
* remove needless anonymous checks
Diffstat (limited to 'src/server/api/endpoints/users')
| -rw-r--r-- | src/server/api/endpoints/users/notes.ts | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/server/api/endpoints/users/notes.ts b/src/server/api/endpoints/users/notes.ts index ef564b3c34..c8be19ff16 100644 --- a/src/server/api/endpoints/users/notes.ts +++ b/src/server/api/endpoints/users/notes.ts @@ -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 |