summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/users
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2018-12-26 23:11:51 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2018-12-26 23:11:50 +0900
commit5174e16f7b85349b84b389fa334e122f9310616c (patch)
tree88ab3e5fab41142702551707c7ee7c3cf73cc3b2 /src/server/api/endpoints/users
parentMake reactions removable (diff)
downloadsharkey-5174e16f7b85349b84b389fa334e122f9310616c.tar.gz
sharkey-5174e16f7b85349b84b389fa334e122f9310616c.tar.bz2
sharkey-5174e16f7b85349b84b389fa334e122f9310616c.zip
Feature to show only my posts in the user page (#3753)
* Fix #3681 * Feature to show only my posts in the user page
Diffstat (limited to 'src/server/api/endpoints/users')
-rw-r--r--src/server/api/endpoints/users/notes.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server/api/endpoints/users/notes.ts b/src/server/api/endpoints/users/notes.ts
index e6df1eeece..ec2dab1290 100644
--- a/src/server/api/endpoints/users/notes.ts
+++ b/src/server/api/endpoints/users/notes.ts
@@ -156,6 +156,7 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
const sort = { } as any;
const query = {
+ $and: [ {} ],
deletedAt: null,
userId: user._id
} as any;
@@ -188,6 +189,22 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
query.replyId = null;
}
+ if (ps.includeMyRenotes === false) {
+ query.$and.push({
+ $or: [{
+ userId: { $ne: user._id }
+ }, {
+ renoteId: null
+ }, {
+ text: { $ne: null }
+ }, {
+ fileIds: { $ne: [] }
+ }, {
+ poll: { $ne: null }
+ }]
+ });
+ }
+
const withFiles = ps.withFiles != null ? ps.withFiles : ps.mediaOnly;
if (withFiles) {