Improved post filtering support on Pleroma and Akkoma #1010
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 afilterInfo
object containing the titleThread muted
.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.