summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes/timeline.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/endpoints/notes/timeline.ts')
-rw-r--r--src/server/api/endpoints/notes/timeline.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts
index 9f32555649..f1d741d5ee 100644
--- a/src/server/api/endpoints/notes/timeline.ts
+++ b/src/server/api/endpoints/notes/timeline.ts
@@ -44,6 +44,10 @@ module.exports = async (params, user, app) => {
const [includeRenotedMyNotes = true, includeRenotedMyNotesErr] = $.bool.optional().get(params.includeRenotedMyNotes);
if (includeRenotedMyNotesErr) throw 'invalid includeRenotedMyNotes param';
+ // Get 'mediaOnly' parameter
+ const [mediaOnly, mediaOnlyErr] = $.bool.optional().get(params.mediaOnly);
+ if (mediaOnlyErr) throw 'invalid mediaOnly param';
+
const [followings, mutedUserIds] = await Promise.all([
// フォローを取得
// Fetch following
@@ -137,6 +141,12 @@ module.exports = async (params, user, app) => {
});
}
+ if (mediaOnly) {
+ query.$and.push({
+ mediaIds: { $exists: true, $ne: [] }
+ });
+ }
+
if (sinceId) {
sort._id = 1;
query._id = {