Add wildcard and exclusion support to message filters - #954
Open
Ed6003 wants to merge 3 commits into
Open
Conversation
Author
|
Opted to use the filter: / f: flag. Inclusions and exclusions can be added comma separated. By default lookup it looks for an exact starts with match. To match anywhere wildcards need to be used ie. string. Not sure if to make this the default behaviour. It is case insensitive by design but I also don't think there is a cheap way to make it case sensitive if required. I've tested it on Vanilla 26.2 with Paper 26.2 build 112 and seems to work as expected for filtering text from chat, signs and commands. |
Ed6003
marked this pull request as ready for review
August 13, 2026 08:24
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.
Closes #159.
What
f:<filter>ona:chat/a:command/a:signlookups only matched the start of a message. This adds:*wildcards, sof:*ban*matches anywhere in a message (translated to SQL%)-to exclude, e.g.f:-/co, combinable with included filters (f:/ban,-/banlist)-marker and*wildcards, sof:-abandf:*a*are still rejectedFilters without a wildcard keep their exact existing SQL and query plan (still use the message prefix index added in
__2_25_0). A wildcard filter that doesn't start with*still uses the anchored portion against the prefix index; a filter starting with*can't, since there's nothing to anchor on.Verification
mvn -B verifypasses.src/testtree, so as a substitute I ran the old and new query-builder logic side by side in a standalone harness across all four supported engines (SQLite, MySQL, DuckDB, ClickHouse): all existing (non-wildcard, non-excluded) filters produce byte-identical SQL and bindings to the current behavior, and placeholder/binding counts match for the new wildcard and exclusion forms.Notes for review
f:<filter>itself is not new (added in 956828b) but was undocumented; I've added it todocs/commands.mdin a separate commit.f:*ban*) can't use the prefix index and will scan — inherent to mid-string matching, which is why I kept anchored filters on their existing plan rather than changing the query shape for everyone.