Commit Graph

178 Commits

Author SHA1 Message Date
Elián Hanisch 8d61d972fd bantracker: remove an useless extra search 2011-06-18 22:43:43 -03:00
Elián Hanisch a9a111b8e6 Bantracker: Don't duplicate bans if for some reason the bot request a ban list.
Only sort bans when the ban list is over.
2011-06-18 22:39:16 -03:00
Elián Hanisch af068e2f91 Bantracker: when unbanning, if there was a problem reading the db,
bt would fail to remove the ban from self.bans.
2011-06-18 22:32:04 -03:00
Elián Hanisch 0a435b668c Bantracker: don't re-add bans that are out of sync into self.bans 2011-06-18 16:27:51 -03:00
Elián Hanisch 62936a986c bantracker: forgot about extbans. 2011-05-31 19:55:38 -03:00
Elián Hanisch d0d7fe616a bantracker: HACK assume bans with exact mask are marks, so they won't get a review. 2011-05-31 19:43:45 -03:00
Elián Hanisch e69ac691c6 Bantracker: trim messages so they are more to the point. 2011-05-31 03:39:28 -03:00
Elián Hanisch f71a3c9929 Bantracker: ignore reviews for bans with a #ubuntu-read-topic forward. 2011-05-31 03:15:58 -03:00
Elián Hanisch 638ccf7b47 Bantracker: strip '%' from quiets in the string that's send to channels/nicks. 2011-05-31 01:45:05 -03:00
Elián Hanisch 223c3f9229 Bantracker: add separate configs so comment request, and review requests,
can be configured independently.
2011-05-29 19:22:34 -03:00
Elián Hanisch 46d07b8095 bantracker: add options --verbose --view and --flush to banreview command.
intended for manually fix the review queue when the bot messes up.
2011-05-29 19:21:27 -03:00
Terence Simpson fd36bffcc0 (large commit, see bazaar log)
[Bantracker]
 * Less spaces in README.txt
 * Remove mention of table 'users' in README.txt
 * Add more detail on how to create the bans database in README.txt
 * Add note about supybot-wizard creating the initial database in README.txt
 * Don't hard-code default values in config.py:configure()
 * Tweak config.py
 * Clean up bans.cgi a bit

[Bugtracker]
 * Comment-out obsolete "bug reporting" variables in config.py
 * Update README.txt and remove "bug reporting" stuff, also remove extraneous license info
 * Comment-out obsolete "bug reporting" code
 * Don't import imaplib

[Encyclopedia]
 * Don't hard-code default values in config.py:configure()
 * Check for 'owner' capability before checking if the hostmask is ignored in plugin.py:checkIgnored()
 * Clean up README.txt

[PackageInfo]
 * Don't hard-code default values in config.py:configure()
 * Update default distributions in config.py:configure()
 * Update defaultRelease in config.py 
 * Update README.txt

* Add a few docstrings to commoncgi.py
* Update COPYING
* Update README.txt
2011-05-28 07:33:21 +01:00
Elián Hanisch 5ed4e67b07 forgot to remove these debug lines. 2010-10-24 03:25:40 -03:00
Elián Hanisch 21c041631f workaround, remove duplicate reviews before sending any. 2010-10-24 03:13:43 -03:00
Terence Simpson 55ca23f755 Make configure() do something for all plugins, also fix a couple of things from r197-203 2010-05-29 14:36:43 +01:00
Terence Simpson 5082202a3e fix++ 2010-05-29 00:55:07 +01:00
Terence Simpson f3de8f84a6 Make a custom anything() function that follows the same form as every other function in supybot.questions, because apparently no one thought this was a good idea... 2010-05-28 23:51:28 +01:00
Terence Simpson ad7a493262 Update copyright/license/author/contributors information
Make sure all files have encoding set to utf-8 unless they already have an encoding
Added COPYING with contense of GPL-2
Added plugin name prefix to all log output. This should take the form of self.log.severity("Plugin: message"),
when not logging from plugin.py use: "Plugin/file_without_dot_py: message"
Bantracker: Made the confgure() function do something, it also creates an initial database if it doesn't exist
Encyclopedia: Made the configure() function do something, it also creates an initial database if it doesn't exist
PackageInfo: Improve the configure() function, it also now creates some initial .list files and prompts to run update_apt and update_apt_file
This goes some way to getting an "ubottu" package together, all we need to do is patch supybot-wizard to download the plugins
from bzr and put them somewhere supybot will see them, then the wizard will do all the initial setup
2010-05-24 14:38:06 +01:00
Terence Simpson b6465cc8bb Don't fetch bans/nicks for channels where Bantracker is disabled 2010-05-22 09:11:37 +01:00
Terence Simpson 0320609071 use /usr/bin/env for #! lines 2010-05-19 14:11:16 +01:00
Elián Hanisch a162404aec Bantracker: try to re-connect to the db if for some reason it didn't connect
or got closed.
2010-05-14 13:17:40 -03:00
Elián Hanisch 42a64c4c18 Bantracker: Don't enqueue ban reviews already in queue. Testcase updated. 2010-05-14 00:09:50 -03:00
Elián Hanisch e5801cf105 merge with devel 2010-04-26 17:37:37 -03:00
Elián Hanisch bb6c417989 fix error handling on cursor.execute
the previous code seemed to try 5 times before giving up, except that
it wasn't inside any loop, so it only tried once and there was no error msg.
Now at least log that there was an error.
2010-04-20 10:27:46 -03:00
Terence Simpson 9d99263232 Fix some IndexErrors 2010-04-20 12:27:35 +01:00
Terence Simpson 2a0e6a1f1a fix check_auth 2010-04-13 05:11:15 +01:00
Elián Hanisch 9ecf076312 new testcase: testReviewIgnore 2010-04-12 23:06:25 -03:00
Elián Hanisch 7538da2329 fix request ignores, It was matching against full hostmask instead of nick.
New testcase: testCommentIgnore
2010-04-12 23:02:07 -03:00
Elián Hanisch 62201d9a12 setup the db before loading the plugin during testing
this fixes a spurious ERROR when the testcase is run for the first time
2010-04-12 21:41:14 -03:00
Elián Hanisch 93f5ef5b9e fix testcases for forced parts 2010-04-12 21:33:15 -03:00
Terence Simpson 02f95832db Don't recognise /remove as a kick and fix hostmaskPatternEqual for 'new' ban-forward syntax 2010-04-13 01:24:45 +01:00
Elián Hanisch c942c3e80d don't use deque objects, since maxlen keyword is only in python 2.6 2010-04-09 12:10:08 -03:00
Elián Hanisch 8612e2291f implement requesting a ban review after a configured time and add some basic testcases
bot owners note that config group 'commentRequest' is now 'request'
request.ignore config now defaults to "FloodBot? FloodBotK? ChanServ"
2010-04-06 21:36:50 -03:00
Elián Hanisch f1b72a7f57 forgot to remove this 2010-04-04 01:39:50 -03:00
Elián Hanisch 484d45e705 use check_auth in banreview, and made a workaround so testcases still pass 2010-04-04 01:31:15 -03:00
Elián Hanisch b6887f5ede config help review 2010-04-03 23:53:05 -03:00
Elián Hanisch ca60ba5aa2 refactor 2010-04-03 23:48:54 -03:00
Elián Hanisch 8e05e8748a refactoring, and fix: config option request.review must be global, since
the review timestamp isn't channel specific
2010-04-03 21:55:59 -03:00
Elián Hanisch 31a9820849 fix updatebt, it failed to recognize extbans, and inserted them again in
the db.
2010-04-03 21:11:22 -03:00
Elián Hanisch deef5dbf37 merge with main 2010-04-03 20:06:29 -03:00
Elián Hanisch b463ee3b26 fix: running @updatebt would trigger a request msg for each new ban.
added option for enable request msg, defaults to False

bot owners should run @config plugins.Bantracker.commentRequest True
2010-04-03 19:46:32 -03:00
Elián Hanisch 44b2133f1c Added a fallback: if for some reason we don't have op's full hostmask,
revert to match by nick for send the review. This may be needed in the
future as operator's full hostmask aren't stored in the db.
2010-04-03 13:20:15 -03:00
Elián Hanisch 75bf9e209c refactor and removed some self.log calls 2010-04-03 01:57:08 -03:00
Elián Hanisch d1d0fc86ab refactoring and getting ready for production, added testcase 2010-04-03 01:44:57 -03:00
Elián Hanisch dda5154237 removed try: except: block 2010-04-03 00:26:20 -03:00
Elián Hanisch fd4516f077 fixed testcases 2010-04-03 00:17:26 -03:00
Elián Hanisch b0b823fef1 config rename:
Bantracker.commetRequest => Bantracker.request
Bantracker.reviewAfterTime => Bantracker.request.review
2010-04-02 23:43:26 -03:00
Elián Hanisch fd55f019e1 remove our ReadOnly option, which was an ugly hack, and use PersistentCache instead 2010-04-02 18:32:19 -03:00
Elián Hanisch 9b0a5d4180 save pending reviews on close so we won't lose them 2010-04-02 17:28:43 -03:00
Elián Hanisch 155d1ae47d banreview command 2010-04-02 14:03:44 -03:00
Elián Hanisch 8bb046e84c refactoring, requested reviews now follow forward options, some fixes 2010-04-02 14:03:01 -03:00
Elián Hanisch b31a266933 keep ban list sorted by time 2010-04-02 14:01:57 -03:00
Elián Hanisch 44b07e6c10 use case insensible dicts here 2010-04-02 14:01:07 -03:00
Elián Hanisch fffc4b58ed run reviewBans every 10min 2010-04-02 13:59:34 -03:00
Elián Hanisch b82f1ae2bc not use super or raise error, causes some problems 2010-04-02 13:51:49 -03:00
Elián Hanisch 621a739198 improved testcases 2010-04-01 17:52:53 -03:00
Elián Hanisch e0c327cc0c match operators by cloak/host instead of nick 2010-04-01 17:52:22 -03:00
Elián Hanisch 6ec87d68dd more testcases for BanTracker 2010-04-01 16:34:59 -03:00
Elián Hanisch 62ee6cf346 skip mutes 2010-04-01 12:48:19 -03:00
Elián Hanisch bfd6a055c1 complete string message 2010-04-01 12:47:56 -03:00
Elián Hanisch a7447c0bef if not dabatase is set, db_run would return None and raise exception. fixed 2010-04-01 12:39:46 -03:00
Elián Hanisch 1807883da2 Use floats in reviewAfterTime, this is less confusing.
And make reviewTime option readonly
2010-03-31 00:03:13 -03:00
Elián Hanisch 0eb45f7822 TestCases for comment request and review request.
run then with "supybot-test Bantracker"
2010-03-30 17:13:51 -03:00
Elián Hanisch 3dd2f09769 reviewAfterTime is now stored in seconds, but when setting the value the unit
is days.

This saves the user for calculating how many seconds a day is, while allowing
me to set times of some seconds for automatic testing.
2010-03-30 17:13:00 -03:00
Elián Hanisch e60e72a620 fix:
- self.name => self.name()
- syntax error
2010-03-30 16:22:10 -03:00
Elián Hanisch 6b3a33ce4c instead of sending reviews immediately, enqueue them and send then the
next time the op says something, that way not only we make sure op is online,
but active as well.
2010-03-30 14:56:35 -03:00
Elián Hanisch 5dfe161bac tweak reviewTime initialisation and comments++ 2010-03-30 14:02:53 -03:00
Elián Hanisch 7c042b4a79 use a config option for store when we last checked for ban review.
That way we can skip bans already reviewed.
2010-03-30 13:32:28 -03:00
Elián Hanisch 82a5cd7d08 repeating function for check if bans need a review 2010-03-30 08:47:16 -03:00
Terence Simpson 298fe02fd9 Merge lp:~symphony/ubuntu-bots/bugfixes for bug #521516 2010-03-28 06:15:26 +01:00
Terence Simpson 39faf3143d * Use deque in Bantracker for logs
* Get "realIrc" object in __init__ of IRCLogin, rather than constantly generating a new object
2010-03-28 04:34:17 +01:00
Elián Hanisch 43485fdc0f new config option: commentRequest.type
For decide which events should trigger a comment request.
2010-03-17 07:14:07 -03:00
Elián Hanisch 5176697e2e little refactoring and tweaks
conf.supybot.plugins.Bantracker => Bantracker (this is sorter)
2010-03-16 21:46:18 -03:00
Elián Hanisch e087d47fc1 fix: nick matching wasn't really case insensible 2010-03-15 23:28:09 -03:00
Elián Hanisch 287038b1e3 cleaned a bit some config option names:
dontRequestComment => commentRequest.ignore
forwardRequest     => commentRequest.forward
forwardChannels    => commentRequest.forward.channels
2010-03-15 23:26:19 -03:00
Elián Hanisch 144291b933 In the case of quiets done by Chanserv, it would be nice to still remind
the op to comment on it, like sending a notice to #ubuntu-ops.
So two new options for this:

forwardRequest: list of nicks for which the request will be redirected
forwardChannels: list of channels where the redirected request will be send
2010-03-15 20:51:32 -03:00
Elián Hanisch bf737d510f tweak priv message so it displays the full command needed 2010-03-15 14:32:09 -03:00
Elián Hanisch c88cc2bbd9 new config option "dontRequestComment"
for prevent sending messages to specific ops, like floodbots.
2010-03-15 13:12:51 -03:00
Elián Hanisch fc99c36faf this looks like a typo: "real_%s" => "%s_real" 2010-03-14 11:16:39 -03:00
Elián Hanisch 8da46db266 catch assert if mask isn't a hostmask, like in realname bans 2010-03-14 10:11:35 -03:00
Elián Hanisch 09d8f38835 Implement private msg for ops requesting to comment his/her bans (LP: #521516) 2010-03-14 10:07:59 -03:00
Elián Hanisch c9fb43ab33 fix syntax error 2010-03-14 10:06:36 -03:00
Terence Simpson fcea1f944f Use hashlib rather than deprecated md5 module 2010-02-04 18:58:05 +00:00
Terence Simpson 75c51ddbc1 More -seven work, mostly on Bantracker, which probably needs a rewrite :( 2010-01-30 15:19:53 +00:00
Terence Simpson 4158d4ba45 Fix previous patch 2009-12-11 18:00:57 +00:00
Terence Simpson 6ffc89d007 BugFix: Bantracker does not parse multiple modes properly (LP: #495555)
Allow Bantracker to search bans by ID
2009-12-11 17:53:15 +00:00
Terence Simpson 562b0faf0f Update author/version/url info 2009-11-26 16:39:34 +00:00
Terence Simpson 31c41dac21 Bantracker: add some convenience functions to Ban class
IRCLogin: Make the Launchpad team configurable
2009-11-04 03:50:49 +00:00
Terence Simpson 55f88b5a60 * Fix a couple more typos/strange supybot errors.
* partial work on LP: #448619
2009-10-15 23:06:18 +01:00
Terence Simpson ed99993d24 More typos 2009-10-15 21:34:18 +01:00
Terence Simpson 7791f6e416 Resync all running ubottu code to bzr branch, they should now be in sync again 2009-10-12 19:26:35 +01:00
Terence Simpson f0e2dffbe2 Update code from working branch and fix a couple of bugs 2009-01-19 22:10:51 +00:00
Terence Simpson d216d25096 typo + authentication without IRCLogin 2008-11-02 01:29:06 +00:00
Terence Simpson 201baa636f And now for something completely different... more fixes 2008-11-02 00:47:25 +00:00
Terence Simpson 687e689b09 Small fixes and documentation updates 2008-10-28 08:09:48 +00:00
Terence Simpson 6aa0afdf2c Update web interface
Upgrade Bzr repository version
2008-09-28 03:11:49 +01:00
Terence Simpson fc610a5794 Fix auth checking in Bantracker (again) 2008-08-08 04:58:47 +01:00
Terence Simpson fc89bc3bdf Yet another update 2008-08-07 21:09:11 +01:00
Terence Simpson 8290296373 Fix broken capability checking and extend with some hierarchy checking 2008-08-07 14:31:26 +01:00
Terence Simpson f173b65390 The "Massive Update" edition:
Mess:
 * Fixed file lookup to not depend on order in config file
Encyclopedia:
 * Lots of small fixes and a few additions
Bantracker:
 * Web-interface now has a special oper: keyword, logs can now be hidden too
 * Added new commands: 'updatebt': Syncs with the channel ban list,
   'coment': Reads or adds a comment for a ban,
   'togglemsg': Toggles /msg's from the bot,
   'banlink': Sends a direct link to the a log with a highlight
 * Updated several commands and made hostname lookup more intelligent
2008-08-04 11:11:15 +01:00