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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Mute Engine #286

Merged
merged 17 commits into from Jan 14, 2018

Conversation

Projects
None yet
2 participants
@pixeldesu
Contributor

pixeldesu commented Dec 18, 2017

This feature adds the ability to extend BetterTweetDeck with custom filters easily. 馃帀

Before this, each custom filter would require taking TD.vo.Filter.prototype.pass apart and adding a new switch.

To not break working behaviour of TweetDeck, the Advanced Mute Engine (AME) includes fallbacks to the old functions used.

The AME has following features:

  • Add custom filters
  • Extends getDisplayType automatically, so the filter list looks just fine
  • Extends the global filter list template with custom filters that should be displayed in the dropdown
    You can hide filters from the dropdown (e.g. if you want to use them somewhere else)

The AME implementation is documented throughout, to not cause confusion on what it's actually doing. I also included documentation on the custom filters, how to add them etc. (see docs/extend/filters.md)

This PR also includes the first custom filter (Hiding Retweets from Users) as a reference implementation.


I went sure that regular BTD would not break with the code submitted in this PR. To surely mitigate any upcoming issues it's recommended to let this code get through an extended beta-testing period.

pixeldesu added some commits Dec 18, 2017

Merge branch 'feature/advanced-mute-engine' of github.com:pixeldesu/B鈥
鈥tterTweetDeck into feature/advanced-mute-engine
馃敡馃搾
- Add ability to set placeholders for custom filters
- Add a license header
- Fix some code nits
- Document how filters work inside TweetDeck
@pixeldesu

This comment has been minimized.

Contributor

pixeldesu commented Dec 27, 2017

This PR is ready 馃帀

If there's anything I need to change, leave a review etc. and I'll adjust accordingly.

is shown, it needs to `pass` filters. If a tweet passes, it's shown. Simple as that.
So, in the function of your custom filter, you need to return `false` (or `t.positive` as an alternative) if something matches your filter. If your filter
returns `true` it's assumed that this tweet doesn't match the current filter and is shown.

This comment has been minimized.

@eramdam

eramdam Jan 6, 2018

Owner

I feel like a warning somewhere about performances and the fact that the function must be synchronous could be useful.

This comment has been minimized.

@pixeldesu

pixeldesu Jan 6, 2018

Contributor

added!

@eramdam

eramdam approved these changes Jan 7, 2018

eramdam and others added some commits Jan 7, 2018

@pixeldesu

This comment has been minimized.

Contributor

pixeldesu commented Jan 11, 2018

Note: This feature will solve #253

pixeldesu added some commits Jan 12, 2018

馃敡馃搾
- Add ability to set custom template string for action filters
- Restructure custom filter display attributes
- Update documentation for custom filters

@eramdam eramdam merged commit 5e92e23 into eramdam:master Jan 14, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@eramdam eramdam referenced this pull request Jan 30, 2018

Closed

Turn Off Retweets #253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment