Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved post filtering support on Pleroma and Akkoma #1010

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Steffo99
Copy link
Contributor

@Steffo99 Steffo99 commented Jan 2, 2025

Another draft PR posted as per #777.

This is in a really bad state, as I quickly hacked it together just to see what was feasible and what was not, but it might be of interest for future, better implementations.

Thread mutes

akkoma and pleroma collapse muted threads in the same way Phanpy filters posts, so the behavior is reproduced in Phanpy by checking for the pleroma.threadMuted property, and by spoofing a filterInfo object containing the title Thread muted.

A muted thread in Akkoma.

A muted thread in Phanpy with this patch.

Add regex filtering

akkoma and pleroma do not implement server-side keyword filtering like Mastodon does, and instead rely on frontends to implement it themselves.

This patch implements very basic client-side filtering in Phanpy, by adding a textarea to Settings where the user can input their own regular expressions to filter, and then by matching those to the contents of each post, then spoofing a filterInfo object containing as title the first regex that matched.

Warning

Since this creates new RegExp objects for each checked post, it probably is very inefficient; ideally, regular expressions should be compiled just once globally, and then just applied to each individual post.

@cheeaun cheeaun added enhancement New feature or request pleroma akkoma labels Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
akkoma enhancement New feature or request pleroma
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants