Add basic regex filter#369
Open
Huhni wants to merge 7 commits into
Open
Conversation
Aga-C
reviewed
Mar 17, 2022
| } | ||
|
|
||
| /// `This tweet was filtered` | ||
| String get this_tweet_was_filtered { |
Contributor
There was a problem hiding this comment.
This file is autogenerated. You should add this string in lib/l10n/intl_en.arb.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I added a filtering option as requested by #86, #148, #287
At the moment it doesn't hide the tweets completely, but instead shows a small card containing
This tweet was filtered.That is because I don't have any experience with Dart/Flutter or Android development in general. I just wanted to provide a minimal working example that can be improved by people who actually know what they're doing.
It works by adding the words you want to get filtered separated by
|to the new Filters setting. It just converts the string into a regular expression so you can use expressions like\W[a-z]{2,3}and so on.Example:
bitcoin|nft|#sponsored|trumpThe filter is case insensitive and removes all tweets containing the regex, so if you don't want tweets with
trumpetremoved you need to usetrump\binstead oftrump. Since the string gets evaluated as regex you need to escape characters like dots or brackets if you want to use them in the filter.