From 8a9928696b4ff7ed2ec235814f532e6acbe2d5a1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 10 Feb 2025 16:56:59 -0600 Subject: [PATCH] accountStatusesController: handle exclude_replies with NIP-50 search ext --- src/controllers/api/accounts.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/accounts.ts b/src/controllers/api/accounts.ts index 23f3190d..40b3e7b6 100644 --- a/src/controllers/api/accounts.ts +++ b/src/controllers/api/accounts.ts @@ -241,14 +241,24 @@ const accountStatusesController: AppController = async (c) => { limit, }; + const search: string[] = []; + if (only_media) { - filter.search = 'media:true'; + search.push('media:true'); + } + + if (exclude_replies) { + search.push('reply:false'); } if (tagged) { filter['#t'] = [tagged]; } + if (search.length) { + filter.search = search.join(' '); + } + const opts = { signal, limit, timeout: Conf.db.timeouts.timelines }; const events = await store.query([filter], opts)