summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/users
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/endpoints/users')
-rw-r--r--src/server/api/endpoints/users/notes.ts40
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