From 1be255ec4c35e47ffb14eb715d9b9cdba9fa077d Mon Sep 17 00:00:00 2001 From: Marcel Hellkamp Date: Fri, 28 Jul 2023 19:21:32 +0200 Subject: [PATCH] Hide posts that would be empty. Hide posts that contain only text or only media if that content type is no displayed anyway. --- src/sources.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sources.ts b/src/sources.ts index 200429a..3b8fb87 100644 --- a/src/sources.ts +++ b/src/sources.ts @@ -198,6 +198,10 @@ const filterStatus = (cfg: Config, status: MastodonStatus) => { if (status.account?.suspended) return false; if (status.account?.limited) return false; + // Filter posts that would show up empty + if(!cfg.showText && ! status.media_attachments?.length) return false; + if(!cfg.showMedia && ! status.content.trim()) return false; + // Accept anything else return true; }