Commit Graph

3669 Commits

Author SHA1 Message Date
Valentin Lorentz
7884ed5133 Merge pull request #1193 from GLolol/fix-disconnects
irclib: handle disconnections correctly for InspIRCd 2.0 networks
2015-11-19 08:01:27 +01:00
Valentin Lorentz
5f361ef180 Conditional: Add command @iferror. Closes GH-1114. 2015-11-14 19:20:25 +01:00
Valentin Lorentz
57b77a6725 utils.web: Rename getUrl to getUrlContent and add getUrlTargetAndContent. 2015-10-25 16:19:49 +01:00
Valentin Lorentz
e3ff413734 Web & core: Merge features of Web's title parser and utils.web.HtmlToText + don't unescape HTML twice. Closes GH-1176. 2015-10-23 07:41:36 +02:00
Jussi Timperi
df7689cc2e Web & utils.web: Force HTMLParser to process all buffered data.
Python issue 23144.
2015-10-22 16:56:53 +03:00
Valentin Lorentz
85ee37c162 Remove unbreakable space. 2015-09-29 17:38:07 +02:00
James Lu
1168b4d0b7 irclib: handle disconnections correctly for InspIRCd 2.0 networks
The old code, which checked for "Closing Link" in the message, wouldn't have matched InspIRCd's way of closing connections (they send "Closing link" with a lowercase l):

DEBUG 2015-09-27T19:15:32 Incoming message (overdrive-irc): ERROR :Closing link: (LilyBot@0::1) [Quit: test]
2015-09-27 19:32:26 -07:00
Valentin Lorentz
b163dc7566 httpserver: Fix Python 2 compatibility. 2015-09-24 15:38:42 +02:00
Valentin Lorentz
a99e674b88 Add support for (anti)capabilities for multi-words commands. Closes GH-1140. 2015-09-23 12:00:18 +02:00
Valentin Lorentz
3047ea7acb Add warning in setup.py about Python 2.6. 2015-09-20 15:50:43 +02:00
Valentin Lorentz
685bedcd74 Add config variable supybot.abuse.flood.command.notify. 2015-09-16 21:32:25 +02:00
Valentin Lorentz
879ce460e9 make utils.web.urlencode return a string, not bytes. 2015-09-09 22:02:19 +02:00
Valentin Lorentz
aa13ac88ea Also send CAP END if no capability is requested. 2015-09-05 13:14:05 +02:00
Valentin Lorentz
f86e25d9fb Prevent authentication hanging if the server supports no capability the bot asks. 2015-09-05 12:43:43 +02:00
Valentin Lorentz
17b1ae2dd5 Prevent 'dictionary changed size during iteration'. 2015-09-02 15:00:29 +00:00
Valentin Lorentz
912d2e1538 core: Apply some suggestions of pyflakes. 2015-08-31 18:19:22 +02:00
Valentin Lorentz
c01a956a8b utils: Remove dependency on parent package. 2015-08-30 17:33:39 +02:00
Valentin Lorentz
c587900c6f Make normalizeWhitespace remove \r as well. 2015-08-30 15:44:07 +02:00
Valentin Lorentz
09cb8e977f supybot-test: Add a new level of verbosity, for showing only unexpected exceptions. 2015-08-29 23:02:20 +02:00
Valentin Lorentz
e5d8315e64 Language. 2015-08-29 21:46:47 +02:00
Valentin Lorentz
a905828b26 Fix Python 2.6 compatibility. 2015-08-26 17:59:50 +02:00
Valentin Lorentz
d1acdb6f92 Fix timezone handling in Python 2 and 3.2. 2015-08-26 17:42:42 +02:00
Valentin Lorentz
943c8bc495 Add support for IRCv3.2 extension chghost. 2015-08-22 20:48:03 +02:00
Valentin Lorentz
39df987274 Fix timezone handling of b338a2370. 2015-08-22 20:38:16 +02:00
Valentin Lorentz
73ed9635b5 Add support for IRCv3.2 subcommand CAP DEL. 2015-08-22 20:25:39 +02:00
Valentin Lorentz
b338a23708 core: Use IRCv3.2 extension server-time to fill IrcMsg.time, if available. 2015-08-22 20:11:46 +02:00
Valentin Lorentz
11c10bb3f1 Add attribute IrcMsg.time. 2015-08-22 18:36:47 +02:00
Valentin Lorentz
33e8966e4b ChannelLogger & core: Use IRCv3.2 extension invite-notify if available. 2015-08-22 18:24:32 +02:00
Valentin Lorentz
6ee24517cb Fix 9c8f05bc16. 2015-08-22 14:25:20 +02:00
Valentin Lorentz
a39238aba9 HTTP server: use two single-stack servers instead of a dual-stack one, and add a config variable to disable this behavior. Closes GH-945. 2015-08-22 13:10:03 +02:00
Valentin Lorentz
543732af3a Fix f8328be5cb so it actually does what it is supposed to do (lstrip removes characters). 2015-08-22 11:18:07 +02:00
Valentin Lorentz
9c8f05bc16 Use IRCv3.2 extension userhost-in-names if available. 2015-08-22 10:33:59 +02:00
Valentin Lorentz
9dd2811950 Split capabilities into a string, as it should be done. 2015-08-22 10:17:32 +02:00
Valentin Lorentz
5501b7cf63 Merge pull request #1156 from jacksonmj/italics
Add support for italic formatting
2015-08-22 09:25:54 +02:00
jacksonmj
8eb5d4f240 Add support for italics
New functions:
ircutils.italic to add
ircutils.stripItalic to remove

And remove italics in ircutils.stripFormatting.
2015-08-21 21:44:11 +00:00
Valentin Lorentz
21da27a846 Merge pull request #1155 from nyuszika7h/ipv4-mapped-addr-fix
httpserver: Strip IPv4-mapped IPv6 addresses
2015-08-21 22:41:33 +02:00
nyuszika7h
f8328be5cb httpserver: Strip IPv4-mapped IPv6 addresses 2015-08-21 22:39:49 +02:00
Valentin Lorentz
f45e2904f5 Merge remote-tracking branch 'mlq/fix/httpserver-read-content-length' into testing 2015-08-17 22:35:40 +02:00
Moritz Lipp
52bebde9df httpserver.py: Pass Content-Length to read call
If a POST request is sent to the built-in http server the handling function does
not terminate because the rfile.read() function blocks.

This patch passes the Content-Length value to the self.rfile.read() function
that is required for it to do not block the method.

Regarding RFC 2616
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4) the
Content-Length header is expected to be sent otherwise this patch assumes a zero
length.
2015-08-17 22:30:21 +02:00
Valentin Lorentz
d56539a0dd Fix http tests on Python 3. 2015-08-15 14:07:01 +02:00
Valentin Lorentz
0254d7b84d Add a decorator to retry tests that fail often. 2015-08-11 17:13:27 +02:00
Valentin Lorentz
c3a2c800f1 Remove need for 2to3. 2015-08-11 16:50:23 +02:00
Valentin Lorentz
f305ff3c02 Remove fix_basestring. 2015-08-10 20:24:11 +02:00
Valentin Lorentz
2c380a4c3a Remove fix_xrange. 2015-08-10 19:36:07 +02:00
Valentin Lorentz
be6bc1a734 Remove need for fix_unicode. 2015-08-10 18:52:51 +02:00
Valentin Lorentz
34d384bd67 Remove need for fix_methodattrs. 2015-08-10 18:09:52 +02:00
Valentin Lorentz
c0ac84bb53 Remove need for fix_import, fix_types, and fix_urllib. 2015-08-10 17:55:25 +02:00
Valentin Lorentz
17bf893437 Fix imports. 2015-08-09 09:21:12 +02:00
Valentin Lorentz
216c5d213f Replace sys.version_info[0] usages with minisix.PY{2,3}. 2015-08-09 00:23:03 +02:00
Valentin Lorentz
5a82cefd51 Remove use of fix_long fixer. 2015-08-08 23:08:49 +02:00
Valentin Lorentz
be118c3338 Remove use of fix_dict fixer. 2015-08-08 23:08:49 +02:00
Valentin Lorentz
ed9f9d0794 Merge pull request #1148 from GLolol/patch-1
ircutils.formatWhois: ignore channels that have +p set
2015-08-08 20:37:17 +02:00
James Lu
8b37e23594 ircutils: fix Python 2.6 compatibility 2015-08-08 18:42:25 +08:00
James Lu
d74e3148b4 ircutils.formatWhois: ignore channels that have +p set 2015-08-08 03:14:46 -07:00
Valentin Lorentz
451ec28163 Merge pull request #1131 from GLolol/allow-unregistered-db-add
Allow unregistered users to use 'add', 'remove', etc. in ChannelIdDatabasePlugin plugins
2015-06-28 23:54:22 +02:00
James Lu
8e51209c3f Fixes to ChannelIdDatabasePlugin as pointed out by @ProgVal
- Quote: factorize tests
- Make supybot.databases.plugins channel specific
2015-06-28 14:36:27 -07:00
Valentin Lorentz
5dabb4539f Merge pull request #1129 from GLolol/raise-peeksize
conf.py: raise protocols.http.peeksize to 8192
2015-06-21 01:36:09 +02:00
James Lu
cdfae05df3 conf.py: raise protocols.http.peeksize to 8192
YouTube has recently updated its site design again so the <title> element falls right out of the 4K mark. This commit raises the default peeksize to 8K, which allows title snarfing to work with YouTube links again.
2015-06-20 14:11:09 -07:00
James Lu
c3ddc585b4 irclib: fix error when SASL is supported but not enabled for a network 2015-06-12 18:07:27 -07:00
nyuszika7h
869c6ce30d Fix capability negotiation 2015-06-12 15:08:45 +02:00
Valentin Lorentz
cf557b516a Fix Python 2.6 support. 2015-05-24 12:29:11 +02:00
Valentin Lorentz
e2b3b917e5 Use CAP LS. 2015-05-24 12:25:42 +02:00
Valentin Lorentz
f85395d8b1 Revert ban description-related commits.
Squashed commit of the following:

commit ea4743caa8bdc7abba99635898ae09a9497c43d3
Author: Valentin Lorentz <progval@progval.net>
Date:   Sun May 24 01:07:49 2015 +0200

    Revert "Channel & core: Add support for ban descriptions. Closes GH-1092."

    This reverts commit 6efea561a5.

    Conflicts:
    	src/ircdb.py

commit d43b9229fe926869852c4abda1da1b18a0093938
Author: Valentin Lorentz <progval@progval.net>
Date:   Sun May 24 01:06:30 2015 +0200

    Revert "Fix import of channel database."

    This reverts commit 8ed5522da0.

commit 6c453d9acb3dc37711cb4d51abd9fe216ca65c08
Author: Valentin Lorentz <progval@progval.net>
Date:   Sun May 24 01:06:27 2015 +0200

    Revert "Fix previous commit."

    This reverts commit 394f1554f7.
2015-05-24 01:08:54 +02:00
Valentin Lorentz
394f1554f7 Fix previous commit. 2015-05-23 21:18:50 +02:00
Valentin Lorentz
8ed5522da0 Fix import of channel database. 2015-05-23 21:00:05 +02:00
Valentin Lorentz
ecdd16c004 Deprecate Twisted. 2015-05-20 22:57:24 +02:00
Valentin Lorentz
721cb06dcd registry: Add a header to the configuration file telling not to edit it. 2015-05-20 13:58:20 +02:00
Valentin Lorentz
dfb68be410 gpg: Confirmed that this error happens on UNIX too. 2015-05-19 16:40:15 +02:00
Valentin Lorentz
a2004b7150 Improve order of connect messages. 2015-05-17 12:31:14 +02:00
Valentin Lorentz
9cb967023e gpg: Don't crash if python-gnupg cannot find the gnupg binary.
Reported traceback:
  File D:python27libsite-packagessupybotgpg.py, line 45, in <module>
    gnupg.GPG(gnupghome=None)
  File D:python27libsite-packagesgnupg.py, line 680, in __init__
    p = self._open_subprocess([--version])
  File D:python27libsite-packagesgnupg.py, line 726, in _open_subprocess
    return Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)
  File D:python27libsubprocess.py, line 710, in __init__
    errread, errwrite)
  File D:python27libsubprocess.py, line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
2015-05-17 12:10:11 +02:00
Valentin Lorentz
5bd0001d02 irclib: Faster connection. (At least 5 seconds less.) 2015-05-17 12:02:31 +02:00
Valentin Lorentz
7cc7ad886f Merge pull request #1107 from GLolol/format-whois
formatWhois: fix errors and restore formatting changes lost in supybot merge
2015-05-16 12:44:49 +02:00
Valentin Lorentz
f1fae13b4a core: Fix IrcChannel.preserve. Closes GH-1106. 2015-05-16 03:59:36 +02:00
James Lu
5190db39a4 formatWhois: Fix channel names having the # cut off 2015-05-15 18:46:28 -07:00
James Lu
c651bc5482 formatWhois: fix error and restore formatting changes lost in supybot merge
This reapplies content from commits 2b324203e7, 2628dc03c4, ef9fbc4a07,
41effcea13, and 5f23855d27.
2015-05-15 18:40:55 -07:00
Valentin Lorentz
82b8bf801a core: Fix merge of upstream's factorization of whois formatting. 2015-05-16 03:21:17 +02:00
Valentin Lorentz
eca7a036aa Socket: Move line decoding to utils.str. 2015-05-16 00:30:20 +02:00
Valentin Lorentz
39d40ec617 Merge branch 'ircv3.2' into testing 2015-05-16 00:22:42 +02:00
Valentin Lorentz
33004696c0 core: Add dictionary of numerics. 2015-05-16 00:20:31 +02:00
Valentin Lorentz
b405f998a5 NickAuth: Add support for account-tag (not tested). 2015-05-15 20:46:18 +02:00
Valentin Lorentz
259457ae2f core: Request capability metadata-notify so plugins can use it if they want. 2015-05-15 19:35:51 +02:00
Valentin Lorentz
59d542bb70 NickCapture & core: Add support for MONITOR. Closes GH-842. 2015-05-15 19:24:24 +02:00
Valentin Lorentz
ba495f5719 Add support for message tags. 2015-05-15 18:08:50 +02:00
Valentin Lorentz
ed37fb6646 String & core: Add support for G flag in matchers. Closes GH-1072. 2015-05-15 16:48:00 +02:00
Valentin Lorentz
487f8c8af5 Merge remote-tracking branch 'supybot/master' into testing
Conflicts:
	.mailmap
	README
	docs/FAQ.rst
	plugins/Ctcp/plugin.py
	plugins/Misc/plugin.py
	plugins/Network/plugin.py
	plugins/QuoteGrabs/plugin.py
	plugins/RSS/README.txt
	plugins/Relay/plugin.py
	plugins/ShrinkUrl/config.py
	plugins/ShrinkUrl/plugin.py
	plugins/ShrinkUrl/test.py
	setup.py
	src/callbacks.py
	src/commands.py
	src/conf.py
	test/test_commands.py
2015-05-15 14:41:08 +02:00
Valentin Lorentz
6efea561a5 Channel & core: Add support for ban descriptions. Closes GH-1092. 2015-05-15 13:43:26 +02:00
Valentin Lorentz
7448c04760 Store the list of server capabilities in IrcState. 2015-05-15 13:01:26 +02:00
Valentin Lorentz
86d9f49aa5 callbacks: Allow Plugin.noIgnore to be a function instead of a boolean. 2015-05-15 12:39:30 +02:00
Valentin Lorentz
3f9118a1a6 utils.str.format: Add support for sets for %L + add test case. Closes GH-1104 2015-05-14 07:14:29 +00:00
Valentin Lorentz
bce47a8a8a Revert "Recommend chardet instead of charade. Closes GH-1096."
This reverts commit 36a646661d.
2015-04-29 10:07:13 +02:00
Valentin Lorentz
36a646661d Recommend chardet instead of charade. Closes GH-1096. 2015-04-29 10:01:10 +02:00
James Lu
562fa14706 ChannelIdDatabasePlugin: allow unregistered users to use commands
This adds a new configuration variable, supybot.databases.plugins.requireRegistration, which defaults to True for maximum security.
2015-04-15 18:01:06 -07:00
James Lu
6add519765 callbacks.py: log plugin name in registryValue='text' errors
This can help with debugging to find what plugins are passing invalid things to registryValue().
2015-04-05 13:44:30 -07:00
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
Valentin Lorentz
4470805b5f core: Remove useless imports. 2015-03-03 09:02:29 +01:00
Valentin Lorentz
72e71edb89 Update string comparison to a newer string. 2015-03-03 08:55:29 +01:00
Valentin Lorentz
6f9960d7a4 Fix crash for commands with ambiguous getopts shortcuts and no docstring. 2015-03-03 08:55:29 +01:00