[feat] apply wordfilters to attachment alt-texts #384

Open
sn0w wants to merge 1 commit from sn0w/akkoma-fe:feature/alt-text-filters into develop
Contributor

many users - myself included - use wordfilters extensively to opt-out of certain sensitive topics / niche microcelebrity circles / etc. for mental health reasons.
this generally works well, but in some cases falls flat with posts leaking through.
a prominent example are memes related to the muted topic that have an empty or very short body the filter can't match.

since fedi has cultivated the habit of alt-texting everything, it would make sense to use that for discovering unwanted content.

i've been test-running this patch on cofe for a few days now and so far it majorly improved my experience.
would be cool to have it in the official FE as well.

many users - myself included - use wordfilters extensively to opt-out of certain sensitive topics / niche microcelebrity circles / etc. for mental health reasons. this generally works well, but in some cases falls flat with posts leaking through. a prominent example are memes related to the muted topic that have an empty or very short body the filter can't match. since fedi has cultivated the habit of alt-texting everything, it would make sense to use that for discovering unwanted content. i've been test-running this patch on cofe for a few days now and so far it majorly improved my experience. would be cool to have it in the official FE as well.
sn0w added 1 commit 2024-04-03 20:52:38 +00:00
Apply wordfilters to attachment alt-texts
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
6f48569e59
Oneric reviewed 2024-05-04 01:09:51 +00:00
@ -8,0 +11,4 @@
for (let attachment of status.attachments) {
res |= attachment.description?.toLowerCase().includes(muteWord)
}
Member

nit: this could directly return as soon as something matches the word

nit: this could directly return as soon as something matches the word

it could also be rewritten as a .some call to remove the loop entirely

res |= status.attachments.some((attachment) => ...)

it could also be rewritten as a `.some` call to remove the loop entirely res |= status.attachments.some((attachment) => ...)
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feature/alt-text-filters:sn0w-feature/alt-text-filters
git checkout sn0w-feature/alt-text-filters
Sign in to join this conversation.
No description provided.