Commit Graph

7108 Commits

Author SHA1 Message Date
Daniel Folkinshteyn 5d6a3c5a46 String: cap maximum soundex length to 1024. 2012-12-16 23:53:13 -05:00
Daniel Folkinshteyn 40bdec92ca Math: calc: coerce argument to ascii string. working with unicode errors on the translate() step. 2012-10-22 11:24:28 -04:00
Daniel Folkinshteyn 463f0c0184 core: make network.channels and channel keys private by default. Otherwise these can reveal secret information. 2012-08-30 15:58:51 -04:00
Daniel Folkinshteyn c7ed79571a Seen: check to see if the bot is in target channel before doing anything.
Otherwise the check to see if user is in channel generated an error.
2012-08-30 15:34:28 -04:00
Valentin Lorentz 031b09307e Math: Allow 'factorial()' in icalc.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-07-13 14:14:24 -04:00
Valentin Lorentz 27857ff6f8 Math: Block factorial() in calc functions.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-07-13 14:14:10 -04:00
Daniel Folkinshteyn c991175425 Math: default %f formatting rounds to 6 decimal places. increase that to 16. 2012-06-12 12:28:26 -04:00
Daniel Folkinshteyn 6dbbb8d06e core: force inet_aton argument to string to prevent occasional error on reconnect.
it /should/ always be a string anyway, but sometimes things break with
a TypeError that it is an int instead of the expected string and hangs
up the bot.
2012-05-31 22:53:21 -04:00
Daniel Folkinshteyn ce121459f7 Channelstats: require caller to be in target channel when using commands in this plugin.
This fixes information leakage from private channels.
2012-02-25 12:35:55 -05:00
Daniel Folkinshteyn 7283235caf Seen: require caller to be in target channel when using commands in this plugin.
This fixes information leakage from private channels.
2012-02-25 12:28:27 -05:00
Valentin Lorentz 37023f5616 MessageParser: fix two misspell
In config.py config var help and in plugin.py docstring
2011-12-25 01:28:51 -05:00
Daniel Folkinshteyn e0c08d3f98 core: avoid casting data to string if it is already an instance of basestring, in irc.reply. 2011-12-13 18:21:38 -05:00
Daniel Folkinshteyn ce9d04eac9 Google: use web scraping as fallback to ig api
ig api doesn't have everything (for one, timezones),
and also, in case the IG api ever dies.
2011-12-12 14:57:10 -05:00
Daniel Folkinshteyn 4fe8fe4b10 Google: use google ig api for the calc. no more web scraping. let's hope this stays alive. 2011-12-12 12:59:27 -05:00
James McCoy 05adad617d Simplify handling of per-network waitingJoins
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit c90fafebe7)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:26:31 -05:00
James McCoy faf2608c83 Bug fixes in src/ircmsgs.py
unbans did send the repr() of the ban list, and IrcMsg.__hash__ did try to hash a list.

Conflicts:

	src/version.py

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 998819da58)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:26:07 -05:00
James McCoy e2f27512bc Only use ircmsg.whois's mask argument if it's non-empty.
Closes: Sf#3121298
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit f6f9e654cb)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:25:45 -05:00
James McCoy be9415912c Perform all received* IrcMsg tagging in one spot.
This also fixes a long-standing failing Misc test since it was relying on the
receivedAt tag.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 4ddfae427f)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:25:26 -05:00
Valentin Lorentz c606ba6d80 Debug: Fix import.
(cherry picked from commit a79e9c0cad)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:25:10 -05:00
James McCoy bcdc8ecb00 Prevent nesting of Misc.tell
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 5b4c150d03)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:24:52 -05:00
James McCoy 63ec70bc08 Use socket.inet_aton for isIPV4 since Windows doesn't (always?) have inet_pton
Closes: Sf#3430008
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 360a2036ac)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:24:42 -05:00
James McCoy d8ead9bc29 One last fix to umode filtering.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 4833976294)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:24:34 -05:00
James McCoy 2fb9ac2024 Fix IRC.do376's handling of supported state
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit d6336421e0)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:24:24 -05:00
James McCoy 23f07cadc2 Fix parsing of 004 message for supported umodes/chanmodes
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 4232e40e26)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:24:04 -05:00
James McCoy ab9365f172 Fix filtering of unsupported umodes
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 3bfda3cc7a)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:23:45 -05:00
James McCoy 865e87cf74 Misc: Avoid setting up "invalid command" flood handling if its not enabled
Closes: Sf#3088554
Signed-off-by: James McCoy <vega.james@gmail.com>
2011-12-12 11:22:16 -05:00
James McCoy 23bfe116ff irclib: Filter out unsupported umodes before sending them to the server
Closes: Sf#3075891
Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit b23480b915)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:13:58 -05:00
James McCoy edbf43f81f irclib: Add support for 004 messages from the server
At a minimum, the message gives us the server name, ircd version, supported
umodes, and supported channel modes.  Add the umodes and channel modes to
self.supported.

Some IRCds (e.g., hybrid and ircd-seven) have an extra arg which seems to be
the channel modes that require arguments.

Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit c9e548bdd9)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:13:23 -05:00
James McCoy c2b6633fe7 Channel.nicks: Raise error so we don't actually reply with the nicks.
Closes: Sf#3396388
Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit 0869a8e271)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:13:03 -05:00
Valentin Lorentz 3248bd79c4 NickCapture: Fix plugin help and l10n-fr. Closes GH-116.
Conflicts:

	plugins/NickCapture/locale/fr.po
	plugins/NickCapture/messages.pot
	src/version.py

Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit a1a90f7673)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:12:09 -05:00
Valentin Lorentz 90b7a83127 Topic: fix typo in @unlock help.
Conflicts:

	plugins/Topic/locale/fr.po
	plugins/Topic/messages.pot
	src/version.py

Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit f1690e6867)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:11:41 -05:00
Valentin Lorentz 3d5f92a61f Topic: Fix bad doctring
Conflicts:

	plugins/Topic/messages.pot

Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit 9561c9f417)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:07:15 -05:00
Valentin Lorentz f3136655e7 Factoids: Fix typo.
Conflicts:

	plugins/Factoids/locale/fi.po
	plugins/Factoids/locale/fr.po
	plugins/Factoids/messages.pot
	src/version.py

Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit 8fb4cbcdc6)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:07:07 -05:00
Valentin Lorentz 0a6d38f37a Channel: fix NameError: 'replyirc' -> 'replyIrc'. Closes GH-73.
Conflicts:

	src/version.py

Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit 8056da06f6)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:07:00 -05:00
Valentin Lorentz 11b5ca3fd7 Karma: fix typo. Closes GH-38.
Conflicts:

	plugins/Karma/locale/fi.po
	plugins/Karma/locale/fr.po
	plugins/Karma/messages.pot

Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit fa8385596d)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:06:49 -05:00
Valentin Lorentz a6f9c1c2d4 Protector: Fix variable name.
Signed-off-by: James McCoy <vega.james@gmail.com>
(cherry picked from commit 70a6e6932d)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:06:40 -05:00
Valentin Lorentz f78803a82b Relay: remove redundant nick on join/part when hostmasks enabled
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit ce4d26514b)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:05:25 -05:00
Valentin Lorentz a93d3fee85 AutoMode: fix bans.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 5dcbe57fa3)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:05:02 -05:00
Valentin Lorentz b99525db63 Owner: Fix bug with @enable and @disable if a plugin is given. Closes GH-43. Closes GH-44.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 8fb97c56bc)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:04:25 -05:00
James McCoy b42b06fe79 RSS._getConverter: Encode strings before handing them off to other functions
When the feed has a specified encoding, we'll be dealing with unicode objects
in the response from feedparser.parse().  To avoid possible UnicodeErrors, we
need to encode() before handing the string off to other functions, so the
other functions are always dealing with bytestrings instead of bytestrings and
unicode objects.  Mixing unicode and bytestrings will cause implicit
conversions of the unicode objects, which will most likely use the wrong
encoding.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 964c73f591)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:04:03 -05:00
James McCoy 50e4b6baf1 String.decode: Only encode('utf-8') when the decode string is unicode
Closes: Sf#3165718
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 01c8dc7f78)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-12-12 11:03:18 -05:00
Daniel Folkinshteyn f9377108b0 Merge branch 'ownerignore' 2011-11-21 15:14:52 -05:00
Daniel Folkinshteyn f3e5223f3f Undo the web title fix because it appears it broke more than it fixed. 2011-11-21 15:14:34 -05:00
Daniel Folkinshteyn 20bfa97649 core: make sure owner is never ignored. also simplify the logic flow in ignore checking.
Thanks m4v for the patch!
2011-11-21 15:09:38 -05:00
Daniel Folkinshteyn b533290c7a Web: fix problems with title snarfer and unicode due to bug in HTMLParser in python 2.6+
Upstream bug: http://bugs.python.org/issue3932
Rather than override the unescape method with the patch posted, we just convert the page
text to unicode before passing it to the HTMLParser. UTF8 and Latin1 will eat just about
anything.
2011-10-11 13:06:27 -04:00
James Vega 1c321409b8 Topic: Ensure do315's response is for a channel in our state object
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 44eb449ba4)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-10-11 11:56:02 -04:00
James Vega 60834f239f Honor supybot-test's timeout option and document the units
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 4661acb3a3)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-10-11 11:55:39 -04:00
James Vega a8736d9a64 Seen: Anchor nick regexp to ensure valid match.
When searching for 'st*ke', 'stryker' would incorrectly match, 'stryke' would
be added to the nick set and the subsequent lookup would cause a KeyError.
This is fixed both by anchoring the regexp ('^st.*ke$' instead of 'st.*ke')
and adding searchNick to the nick set instead of the string that matched the
pattern.

Closes: Sf#3377381

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 0cd4939678)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-10-11 11:55:27 -04:00
James Vega 59936f52f3 Update Internet.hexip to handle IPv6
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit b0e595fbd2)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-10-11 11:55:16 -04:00
James Vega 5c9139990b Update Internet.dns to handle IPv6 IPs and responses
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit d56381436c)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2011-10-11 11:55:06 -04:00