-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
[Proposal] Better ignore system #1355
Comments
I rewrote the blocks module in alanhuang122/sopel@0d0b73a to take IRC hostmasks only. (ignore the change on line 303; it's hardcoded specific minor behavior). Perhaps that could be useful as a reference? |
Could be a good start, yeah. Thanks for the pointer! I'm just shaking my head a bit that you didn't even have to change the docstring for |
Pushing off to Sopel 7. Version 6.6.0 has gotten too bloated, and this can wait until the next major release. |
Just a few weeks left before target release date for 7.0 and this isn't even started. It can wait. |
Is there a reason not to turn both host_blocks and nick_blocks into hostmask_blocks? E.g. adding a "nick" block could turn into a hostmask "{nick}!.@." block, unless we're worried about regex matching overhead. |
From an internals perspective, I think yes: matching "host_blocks" on host and "nick_blocks" on nick gives us less overhead, because we're already parsing those components out of the incoming line to populate the trigger object. It's done for free, and it reduces the amount of text each block type needs to process. That said, one could also say that having three different lists to process gives us higher overhead anyway, just of a different type. The idea of having default ban types that wildcard out part of the hostmask when given a nickname is great, but I think not for |
Some more thoughts regarding the ignore/blocks system, from things I do with my own bot.
|
Blocking by command is sort of possible for channels via config. It's clunky though. I'm hoping most of that could be implemented by a plugin once we get hooks (#1546) in, though, rather than forcing core to handle it all. |
So, just a quick note: we can use the fnmatch built-in module for that. In particular, we can use the |
I was going back through really old issues I opened and came across dgw/sopel-BombBot#12 and dgw/sopel-BombBot#13. These still remain unimplemented after almost 5 years mostly because there's no way I, as a plugin developer, want to deal with using Sopel's various block lists to check whether a potential target's attempts to win the game would be ignored. Seems like a possible new API feature, loosely related to this overhaul of the ignore system. Whether it's part of the ignore system, I don't know/care. It could be a new field on Any immediate "PLS NO" thoughts from the crew on this issue before I write up that proposal for 8.0? |
Something like |
Added |
These are not, and AFAICT never have been, actual host*masks*. Having the subcommand name and code variables refer to them as (host)masks has been a point of confusion for, literally, years. This is just the first step toward making the ignore/block system work more intuitively, but you know what they say about journeys of a thousand miles... For full context, thought processes, tentative future plans, and so on: See #1355.
We don't have "hostmask" blocks any more; only "host". This is part of a fairly long saga to sane-ify the `.blocks` command: sopel-irc/sopel#1355
I noticed this weekend that
.blocks add hostmask <regex>
actually adds a host block, and doesn't work as expected if given an actual hostmask, e.g.*!*@bad-domain.tld
. Ignoring the fact that I gave an invalid regular expression (starts with a quantifier),.*!.*@bad-domain\.tld
won't work as expected either.What
.blocks add hostmask
actually does is add to thehost_blocks
, which does exactly what it says on the tin: It blocks based on the line originator's host. It's a bit confusing, due to the command naming.The simple solution would be to rename the
.blocks ___ hostmask
commands to.blocks ___ host
, but I'd like to do more than that:.blocks ___ hostmask
commands to.blocks ___ host
(coretasks:.blocks hostmask
->.blocks host
#2344, for 8.0).blocks ___ hostmask
command set that actually works on hostmasksbot.is_ignored(Identifier)
?) to check an arbitrary user Sopel knows aboutTrigger
attribute(s) so@plugin.unblockable
callables can tell if they've been called in spite of a block entry/nick-?regex/
vs.nickname
(/
will never appear in a valid hostmask, hostname, or nickname, so it's a logical choice)*
and?
)The first three items definitely can be done in Sopel
6.x7.x, as the only users who can actually use the ignore-system commands are bot owners/admins who read the changelogs before upgrading. (You do read changelogs before upgrading, riiight? 😛). Validation would be a nice non-breaking enhancement, too.I'm less inclined to change how config file entries are interpreted in a point update, so making regex syntax optional might be a Sopel
78 thing. But if there's a clean way to just quietly tweak existing configs on first start and make all existing ignore entries into the regex variety (however that's represented in the file), it doesn't have to wait. The biggest barrier to that is that Sopel's config file isn't versioned—but determining the config format version is easy if it doesn't contain a version! 😁Self-assigned this because I already started thinking about the implementation, but no code has been committed Yet™. Therefore, it's also Patches Welcome until I actually prototype (some of) the changes.
The text was updated successfully, but these errors were encountered: