Commit Graph

7184 Commits

Author SHA1 Message Date
Valentin Lorentz 6a134eb302
Update string comparison to a newer string.
Signed-off-by: James McCoy <vega.james@gmail.com>
2015-03-26 02:04:06 -04:00
Valentin Lorentz b0846f914e
Fix crash for commands with ambiguous getopts shortcuts and no docstring.
Signed-off-by: James McCoy <vega.james@gmail.com>
2015-03-26 02:00:43 -04:00
James McCoy cffbd959e8
Add handling of 437 (nick temporarily unavailable) errors
Servers bind a nick to a connection for a short window after it
disappears to try and avoid contention over nicks.  This may cause a 437
during connection to a server (c.f. ProgVal/Limnoria#1033) or even
during normal nick changes, if the timing is lucky.

Add handling for this error to the startup code and the Admin plugin.

Signed-off-by: James McCoy <vega.james@gmail.com>
2015-03-26 01:33:04 -04:00
James McCoy c3695c9419
ircutils: Add formatWhois function
Parsing through the various WHOIS replies to build a formatted string
isn't a trivial task, especially since there is some privacy related
information.  Consolidate this handling into a single function so
there's one place to fix bugs.

Also fix an issue with people putting (unterminated) formatted text into
the "realname" field of their IRC client (c.f., ProgVal/Limnoria#1083).

Signed-off-by: James McCoy <vega.james@gmail.com>
2015-03-26 00:11:36 -04:00
James McCoy a8cd99f121 commands._getRe: Restore original args for any failure
String.re uses first('regexpMatcher', 'regexpReplacer').  If the args
provided to String.re are not a matcher and are longer than a single IRC
message (e.g., from a nested command), then regexpReplacer would never
be tried.  A too long error should be handled the same as running out of
args while trying to find a valid regexp.

Signed-off-by: James McCoy <vega.james@gmail.com>
2015-02-18 22:09:38 -05:00
Valentin Lorentz b99ff28e33 utils.web.getUrl: add the 'timeout' argument (and fix the doc of getUrlFd).
Signed-off-by: James McCoy <vega.james@gmail.com>
2015-02-18 19:53:42 -05:00
James McCoy 2fda75e1b2 Allow >= 2.0 versions of python-dateutil
Signed-off-by: James McCoy <vega.james@gmail.com>
2015-01-01 14:51:34 -05:00
James McCoy 4f489fad61 Move project pointers from Sourceforge to GitHub
Closes Supybot/Supybot#7
Signed-off-by: James McCoy <vega.james@gmail.com>
2014-12-18 21:31:59 -05:00
Valentin Lorentz 5e8896fe6d QuoteGrabs: Prevent quote grabs from queries.
Signed-off-by: James McCoy <vega.james@gmail.com>
2014-12-18 21:12:27 -05:00
James McCoy 20509a19c7 Merge pull request #8 from Mkaysi/master
.mailmap: coerce my old name to my new
2014-08-24 22:50:30 -04:00
Mikaela Suomalainen 3bfa148c88 .mailmap: coerse my old name to my new 2014-08-23 10:43:20 +03:00
James McCoy a629f51328 Anonymous: Move "say $nick" functionality to new tell command
Allowing Anonymous.say to send a message to either a nick or an
(implicit) channel through the use of first('nick', 'inChannel') changed
the behavior of the command by making it impossible for 'inChannel' to
take effect.

This meant that any previous users of the command that expected "say
some text" to send "some text" to the current channel would instead try
to send "text" to the user "some".  Depending on the value of
conf.plugins.Anonymous.allowPrivateTarget, this would result in either
an error or a strange message to a random user.

Creating a new tell command solves this issue as Anonymous.channel now
goes back to its simple 'inChannel' wrapper.

Signed-off-by: James McCoy <vega.james@gmail.com>
2014-07-09 21:03:26 -04:00
James McCoy 3d993a0cab callbacks: Properly handle nested command errors
Using Raise=True was only papering over the real problem in the nested
command error handling.  The actual issue is that we were trying to
return an IrcMsg from NestedCommandsIrcProxy.__init__.  Dropping
Raise=True and moving return to its own line is the correct fix and
resolves the test failure in testMaximumNestingDepth.

This commit reverts 7838cae3bc

Signed-off-by: James McCoy <vega.james@gmail.com>
2014-06-29 19:12:22 -04:00
James McCoy 27ffff7ad6 release: Remove reference to freshmeat^Wfreecode
freecode.com, nee freshmeat.net, is now a completely static site.  Since
it is no longer allowing updates, no need to worry about pushing
information about Supybot releases to it.

Signed-off-by: James McCoy <vega.james@gmail.com>
2014-06-22 22:36:16 -04:00
James McCoy f5df6695c0 Alias: Restore recursion limit and limit memory use
The (faulty) detection of recursive Aliases was removed in
a656fd0693, claiming that "our nesting
limit will catch issues now."  However, nested Aliases weren't actually
increasing the nesting level.

Actually increasing the nesting level when an alias is executed restores
the intended behavior.  Additionally, limiting the size of the
expanded arguments to an alias prevents exponential growth of memory
usage for certain malicious inputs/aliases.

Signed-off-by: James McCoy <vega.james@gmail.com>
2014-06-09 23:48:41 -04:00
James McCoy 7838cae3bc callbacks: Use Raise=True for nested limit errors
Signed-off-by: James McCoy <vega.james@gmail.com>
2014-06-09 23:44:25 -04:00
venth 76599db944 questions.yn: Perform string, not identity, comparison against 'y'
The `is` operator performs object identity comparison.  Changing to `==`
implements the expected behavior.

Use the mock library to add tests verifying the API of questions.yn.
2014-06-01 22:52:58 -04:00
venth 6456a35817 ignore Intellij IDEA related files 2014-05-07 23:52:59 -04:00
James McCoy 949c093952 Correct the URL reported by Misc.source
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2014-01-05 22:35:28 -05:00
James McCoy 4d677dbcf5 Seen: Fix any to work with wildcards when protocols.irc.strictRfc is true
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-10-13 10:00:33 -04:00
James McCoy cfe71c4f55 Add a .mailmap to coerce my old name to my new 2013-10-10 20:56:19 -04:00
James McCoy bf48d521f2 Use generic setuptools instead of requiring distribute
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-10-10 20:37:12 -04:00
James McCoy 56a6799deb commands: Consolidate state.channel checks into getChannel
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-10-10 18:54:50 -04:00
James McCoy 6361b1e856 ircdb: Deduplicate hostmasks in IrcUser.addAuth
If addAuth is called with a hostmask that already exists (exactly, not
just equivalent patterns) in self.auth, remove the entry for the old
authentication.  This essentially updates the timeout for the hostmask.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-09-22 11:13:52 -04:00
James McCoy 4bc549c1ed Prevent exception when replying with a genericNoCapability error
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-31 23:04:38 -04:00
Valentin Lorentz cf975227ba Factoids: Fix help of @random.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-26 21:38:03 -04:00
Valentin Lorentz 01a6ed6540 Fix use of rsplit for IPv6 addresses.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-26 21:37:12 -04:00
James McCoy 0283bb7f9a ShrinkUrl: Fix the check for ur1ca results.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-24 08:51:33 -04:00
James McCoy ea7f1f8419 Socket: Match the expected API of reconnect
driver.reconnect(wait=True) should flag a driver to reconnect, but not
immediately.  The Socket driver lost its handling of this flag in
8730832e.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-24 00:29:16 -04:00
James McCoy a483fef39d RSS: Ensure results is declared before trying to access it
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-24 00:04:29 -04:00
James McCoy e7d0bfd2d0 commands: Handle OverflowError in _int
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-23 23:36:44 -04:00
Arnout Engelen 58e7e61d69 Only reset the cached feed when the response actually contains headlines
Some feeds, such as those from sourceforge.net, will sometimes show an error
page rather than a feed. In this case the feed cache used to be cleared for
that feed, causing all 'old' headlines to be flooded to the channel as soon
as the feed came back online.

This patch hopefully fixes that by only resetting the cache when the returned
page actually contains headlines.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-23 23:13:28 -04:00
James McCoy 333067c151 Provide a default help message for commands without help.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-23 22:57:13 -04:00
James McCoy e421722960 Fix crash if a custom error message is provided to somethingWithoutSpaces
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-23 22:06:07 -04:00
James McCoy c73ead8aef supybot-botchk: Directly execute supybot instead of running it in sh
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-23 21:42:01 -04:00
Valentin Lorentz 960e1da61c commands.py: Fix error message of getSomethingWithoutSpaces.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-23 00:29:11 -04:00
James McCoy 5b329df6f0 Socket: Try all resolved addresses before scheduling a reconnect
Instead of assuming the first address returned from getaddrinfo can be
reached, try each one in turn until a connection is established.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-22 23:43:09 -04:00
James McCoy 88e4f73777 getSocket: Use returned family to create the socket
The existing code was parsing the passed in host to determine what type
of socket family to create.  getaddrinfo already provides this for us,
so there's no need to perform our own, potentially buggy, parsing.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-08-22 23:40:28 -04:00
Valentin Lorentz caa36121a7 ShrinkUrl: Add ur1.ca support.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-01-08 22:54:02 -05:00
Joe Julian a8e3081b18 ShrinkUrl: Support for goo.gl url shortener.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-01-08 22:44:35 -05:00
Terje Hoås 2327317b33 Web: Fix fetch. Use getUrl instead of getUrlFd.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2013-01-08 20:32:43 -05:00
James McCoy 295f9b1f0d Make utils.str.soundex perform better when length is large
Closes: Sf patch#148
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-12-31 17:29:02 -05:00
Valentin Lorentz 8d8e574d12 Owner: fix error message when the ImportError comes from the plugin 2012-12-02 20:35:52 -05:00
Daniel Folkinshteyn 3c30463e11 Math: default %f formatting rounds to 6 decimal places. increase that to 16.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-11-04 19:48:53 -05:00
Daniel Folkinshteyn 910ad6dd62 core: make network.channels and channel keys private by default. Otherwise these can reveal secret information.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-11-04 19:43:36 -05:00
Valentin Lorentz ac13d09511 conf.py: Prevent traceback if server address is an IPv6 address.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-11-03 14:48:16 -04:00
Daniel Folkinshteyn c68afacc0f Math: calc: coerce argument to ascii string. working with unicode errors on the translate() step.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-10-30 19:09:45 -04:00
Valentin Lorentz 484d7e6fac Misc: Notify the caller when @tell succeeded. Closes GH-97.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-10-24 17:36:21 -04:00
Valentin Lorentz 9b8397193b Admin: Add clearq command.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-10-24 01:45:38 -04:00
Valentin Lorentz 8062d9592c Change the minimal number of non-wildcard characters in hostmask from 8 to 3. Closes GH-276.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-10-24 01:36:19 -04:00