All hostmask and account comparisons are now case-insensitive (nicks
still aren't, related to #217 -- changing nick sensitivity would break
everything in numerous places).
Also, refactor some things into other files where it makes sense to do
so, because putting unrelated things into the same commit is fun.
- fwarn/warn commands to view and manipulate warnings
- fstasis can now only decrease stasis, not add to it
- refreshdb command can sync bot game state with what is in the db
(including expiring any unexpired stasis or warnings)
- stasis now expires
- tempban is still not implemented and will not be implemented as
part of the PR (it will come later, if ever)
- sanctions can be automatically applied after warnings cross a
certain threshold; some defaults are configured
- Always apply host-based allows/denies even in var.ACCOUNTS_ONLY is set
- Fix display of mixed-mode allows/denies for a particular user
- Make -acc and -host switches operate more intelligently on both the
bare command as well as when given an argument
This allows for things like making ADMINS/OWNERS take a full hostmask,
or fallowing/fdenying a full hostmask with wildcards. It also allows for
a distinction between two people that share a hostmask but have a
different ident.
stasis now checks all matching stasis and returns the highest amount
fallow/fdeny have two new options -acc and -host to explicitly specify
what type the argument is
-cmds in fallow/fdeny show commands from all matching masks, to bring it
in line with how actual allow/deny parsing works, before it would only
show the first match
Right now the only thing that still tracks accounts if DISABLE_ACCOUNTS
is True is stats stuff (in sqlite), as I'm unsure of how we want to
handle that for when accounts aren't enabled; likely track by nick but
unsure on that right now.
This further implements issue #112 but doesn't fix it entirely yet.
_collections is the C implementation (and where defaultdict lies), and
is as such already loaded when the interpreter is launched. collections
imports a bunch of other useless stuff we're not interested in.