Commit Graph

5936 Commits

Author SHA1 Message Date
Valentin Lorentz
f1a5ab4866 String: Add unicodename and unicodesearch commands. 2021-03-11 22:49:13 +01:00
Valentin Lorentz
54342765cd LogToIrc: Make variables channel- and network-specific when relevant 2021-03-11 20:20:53 +01:00
Valentin Lorentz
7359ddce90 LogToIrc: better error handling 2021-03-11 00:40:43 +01:00
Valentin Lorentz
f0b4332908 LogToIrc: Update __init__/die signatures. 2021-03-11 00:40:43 +01:00
Valentin Lorentz
6d880c9a6f LogToIrc: Move IrcHandler to its own module, it shouldn't be reloaded. 2021-03-11 00:40:43 +01:00
Valentin Lorentz
436277a9ed LogToIrc: Run 2to3 2021-03-11 00:40:43 +01:00
Valentin Lorentz
e9ef8b22c0 LogToIrc: Split into modules, like modern plugins 2021-03-11 00:40:43 +01:00
Valentin Lorentz
d08dd24e43 LogToIrc: Resurect from from before the Darcs migration.
Last commit: da614f5561
2021-03-10 22:24:12 +01:00
Valentin Lorentz
c0527b6859 String: update docstrings of ord/chr, we're using unicode now 2021-03-10 22:19:35 +01:00
Valentin Lorentz
ce03729f20 ShrinkUrl: Improve error messages when opening the database. 2021-03-09 23:13:16 +01:00
Valentin Lorentz
36800ed4bc ShrinkUrl: Fix tinyurl.com test 2021-03-09 23:12:54 +01:00
Valentin Lorentz
4aca6e3d5a Add support for receiving commands from draft/multiline batches. 2021-03-04 21:34:25 +01:00
Valentin Lorentz
975a9101f4 Services: Fix conditional on supybot.protocols.irc.experimentalExtensions
It was always true-ish because we tested the variable itself instead
of its value.
2021-03-04 21:30:07 +01:00
Valentin Lorentz
8b497af30b Services: Add support for REGISTER responses in nested batches. 2021-03-04 18:48:15 +01:00
Valentin Lorentz
78dc45e99e Aka: eliminate race condition in tests?
Sometimes (very rarely), the test errors with:

```
======================================================================
FAIL: testHistsearch (Aka.test.AkaChannelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/supybot/test.py", line 214, in runTest
    originalRunTest()
  File "/usr/lib/python3/dist-packages/supybot/plugins/Aka/test.py", line 67, in testHistsearch
    self.assertResponse('histsearch .*', '@echo foo')
  File "/usr/lib/python3/dist-packages/supybot/test.py", line 402, in assertResponse
    self.assertEqual(m.args[1], expectedResponse,
AssertionError: '@aka add histsearch "last --from [cif true[80 chars]"]]"' != '@echo foo'
- @aka add histsearch "last --from [cif true \"echo test\" \"echo test\"] --regexp [concat \"m/$1/\" [re s/g// \"@2\"]]"
+ @echo foo
 : '@echo foo' != '@aka add histsearch "last --from [cif true \\"echo test\\" \\"echo test\\"] --regexp [concat \\"m/$1/\\" [re s/g// \\"@2\\"]]"'
```

ie. histsearch returns the 'aka add' message instead of the 'echo foo'
one.

My guess is that if they happen too closely to each other, they get
added to the history in the wrong order (how? it's not threaded)

So this commit works around the issue by making the regexp unambiguous.
2021-02-21 00:18:03 +01:00
Valentin Lorentz
85549bf0c3 Services: Fix typo in docstring 2021-01-30 19:41:26 +01:00
Valentin Lorentz
c016ed5bfd Services: Add support for batches as reply to REGISTER/VERIFY.
Oragono uses them.
2021-01-25 22:03:08 +01:00
Valentin Lorentz
1c6c1cb16a Services: Add initial implementation of the @register and @verify commands.
Using this early draft specification:
https://gist.github.com/edk0/bf3b50fc219fd1bed1aa15d98bfb6495
2021-01-25 21:57:12 +01:00
Valentin Lorentz
7110b8f74e Relay: Set msg.channel before passing it to _sendToOthers.
_sendToOthers expects msg.channel to be 'in otherIrc.state.channels',
but IrcMsg objects don't have their 'channel' attribute set until they
are passed through irclib, so it was left unset, which means messages
were never sent at all.

Regression introduced in c1ae3f5c81.
2021-01-15 21:25:02 +01:00
Valentin Lorentz
81a7530577 Network: add @capabilities command. 2020-11-09 21:45:01 +01:00
James Lu
5ee63ebe96 SedRegex: test "nick, " prefix for explicit reference as well as "nick: " 2020-10-18 13:44:05 -07:00
James Lu
6c138d66ba SedRegex: follow config preference for strictRfc checking
Also add some tests to check that nicks containing the sed separator character are handled correctly.
2020-10-18 13:44:05 -07:00
Valentin Lorentz
5195ff8e12 Web: Add new @location command, to follow HTTP redirects.
Useful to un-tinify URLs.
2020-10-13 22:28:52 +02:00
James Lu
d52e2aa829 SedRegex: rename SearchNotFound -> SearchNotFoundError 2020-10-12 19:50:53 -07:00
James Lu
b05fe01d66 SedRegex: reword "search not found" error
"Search not found in the last X *messages*" is a bit confusing because this is really counting the entire history, which includes all other lines of IRC communication (this means pings, /NAMES replies and so on).
2020-10-12 19:48:56 -07:00
James Lu
9adb4f0e8c SedRegex: ignore regexp-like messages sent before the plugin is active
Reported by fred` at #limnoria.

This adds a new message tag applied to all messages SedRegex has seen, in addition to the one for marking messages parsed as a regexp.
SedRegex will now look through the message history and check that all messages without the "seen" tag are not in fact a regexp, before
marking it as seen so that it doesn't do repeated work.
2020-10-12 19:45:18 -07:00
James Lu
ffa24bf56e SedRegex: add a no match test case 2020-10-12 18:53:54 -07:00
Valentin Lorentz
c04b31ae32 RSS: include channel name in 'feed is announced but does not exist' error log. 2020-10-10 11:51:56 +02:00
Valentin Lorentz
4bd5d8eb33 RSS: Fix announce removal to work with net+chan-specific config
It only removed the value from the chan-specific value.
2020-10-10 11:51:56 +02:00
mogad0n
df6ebc78a0
Add command @scheduler remind
This is a safe command for admins to allow as it's limited to text reminders,
unlike the equivalent scheduler.add (+ misc.echo) which usually needs to be
restricted to prevent abuse
2020-10-07 21:42:53 +02:00
Valentin Lorentz
16b7fd9f37 Misc: Fix log message on invalid commands in private
It showed 'Not replying to <command> in None,', since channel is None in
private (unlike the former msg.args[0], which was the bot's nick).

I wasn't careful enough when I replaced msg.args[0] with msg.channel
across the codebase.
2020-09-30 10:25:22 +02:00
Valentin Lorentz
38b0541f04 Autocomplete: fix typo in README. 2020-09-27 15:24:05 +02:00
Valentin Lorentz
6da0e7fc5f Math: Fix test on Python 3.10 (nightly) 2020-09-19 10:38:07 +02:00
Valentin Lorentz
0102d64cf4 RSS: fix tests with feedparser 6.
Mocks the urllib API it uses instead of an internal function.
2020-09-19 10:15:23 +02:00
Valentin Lorentz
864315cc5f Config: Don't prepend @ to config value names if their only children are networks. 2020-09-09 15:23:58 +02:00
Valentin Lorentz
bdbb74f046 BadWords: Re-allow words with a space (aka 'phrases')
I disallowed it in f3f628ddba because they
couldn't be deserialized properly.

This commit adds a new 'phrases' config var in addition to 'words',
that is comma-separated instead of space-separated.
2020-09-05 22:59:09 +02:00
Valentin Lorentz
6a3be33fcd registry: Don't use an internal state for Regexp, it breaks net- and chan- specific values. 2020-09-05 21:40:40 +02:00
Valentin Lorentz
f3f628ddba BadWords: disallow adding words with a space in them.
Deserialization splits on spaces, so they are not preserved properly.
2020-09-05 21:37:32 +02:00
Valentin Lorentz
77682cc50b ChannelLogger: Add tests for non-relayed messages when rewriteRelayed is True. 2020-08-30 14:52:45 +02:00
Valentin Lorentz
01dc289cd6 ChannelLogger: write tests for relayed privmsg 2020-08-30 14:42:10 +02:00
Valentin Lorentz
7887001ea3 ChannelLogger: write tests for privmsg and notice. 2020-08-30 14:36:33 +02:00
Valentin Lorentz
a33af98af1 ChannelLogger: add tests for getLog. 2020-08-30 12:19:36 +02:00
Valentin Lorentz
811ccfe3bf ChannelLogger: update comment 2020-08-29 22:53:25 +02:00
Valentin Lorentz
532d38d6da ChannelLogger: Fix typo in variable name.
Bug introduced in f253da049d.
2020-08-29 22:49:06 +02:00
Valentin Lorentz
6f5d8c3011 Autocomplete (+ Fediverse): configure Black. 2020-08-29 18:44:32 +02:00
Valentin Lorentz
7710edb5fe Autocomplete: flake8 2020-08-29 18:39:03 +02:00
Valentin Lorentz
d0eb48c90e Autocomplete: more readable test failures. 2020-08-29 18:38:57 +02:00
Valentin Lorentz
6f34f377e5 Autocomplete: return only the common prefix + one word. 2020-08-29 18:38:39 +02:00
Valentin Lorentz
efb4d476a5 Autocomplete: Only return the end of the current word (or the next one if the current word is finished) 2020-08-29 18:19:00 +02:00
Valentin Lorentz
fbf9f0166d Autocomplete: Fix name of response tag. 2020-08-29 16:42:19 +02:00
Valentin Lorentz
a55fbab591 Autocomplete: Initial implementation.
This plugin implements the first version of
https://github.com/ircv3/ircv3-specifications/pull/415
2020-08-29 16:33:29 +02:00
Valentin Lorentz
f253da049d ChannelLogger: rewrite relayed messages echoed by the server
The former code worked only with emulated echo-message, as it depends
on internal tags.
In case echo-message (and labeled-response) is enabled, rely on
remembering the label instead.
2020-08-23 16:34:59 +02:00
Valentin Lorentz
91d2a2860f ChannelLogger: Fix regression preventing outgoing messages from being logged.
Since eb1e27e20b, IrcCallback.__call__ filters out
privmsgs and notices sent by the bot itself unless echoMessage=True is set.
2020-08-23 16:32:47 +02:00
Valentin Lorentz
a84eabf146 Factoids: Add --author filtering to @search. 2020-07-14 18:16:10 +02:00
Gordon Shumway
6e47278b9f
Google: Set User-Agent override. (#1426)
With a custom (globally-configured) user-agent, Google may serve a different page, which breaks this plugin.

This override disables this custom user-agent and uses a predefined one, which is known to work.
2020-07-14 14:44:43 +02:00
Gordon Shumway
e5a04aaf13 DDG: Add region test. 2020-07-06 22:34:29 +02:00
oddluck
1c1ba1119d DDG: Add region and safeSearch configs. 2020-07-06 22:34:29 +02:00
Gordon Shumway
902677a378 DDG: Fix redirect detection. 2020-07-06 22:34:29 +02:00
Valentin Lorentz
76edd3189c Herald: Use time.monotonic instead of time.time.
To prevent jumping backward and forward on system clock changes.
2020-07-03 21:00:43 +02:00
Gordon Shumway
9081f5678b Herald: Throttle default heralds.
Fixes https://github.com/ProgVal/Limnoria/issues/1372
2020-07-03 08:39:05 +02:00
Valentin Lorentz
138957676e DDG: better document the transitions in the parser. 2020-07-01 20:06:29 +02:00
Valentin Lorentz
427cf82d6b DDG: Add debug prints in the parser. 2020-07-01 20:05:23 +02:00
Gordon Shumway
59f1441d23 Google: Fix plugin. 2020-07-01 10:37:22 +02:00
Gordon Shumway
01f166a224 Google: Fix plugin. 2020-07-01 10:37:22 +02:00
Valentin Lorentz
9be5676dfd DDG: Update lite search URL.
Duckduckgo started redirecting https://duckduckgo.com/lite to https://lite.duckduckgo.com/lite
so it was mistakenly interpreted as a !bang.
Changing the initial URL fixes this false detection.
2020-07-01 10:33:26 +02:00
Valentin Lorentz
ef59a033e3 Channel: add support for MODES= with no value in ISUPPORT.
Oragono uses that.
2020-06-27 07:51:16 +02:00
Valentin Lorentz
0e2b0a96c8 SedRegex: Log error exceptions from the replacer. 2020-06-20 12:38:44 +02:00
Valentin Lorentz
88d0a3a79f NickAuth: Add WHOX test. 2020-06-12 19:29:08 +02:00
Valentin Lorentz
99e8b598d0 NickAuth: Add test for extended-join. 2020-06-12 19:11:29 +02:00
Valentin Lorentz
99cb656df0 NickAuth: Detect extended-join based on capability.
It's more reliable than just checking the number of arguments
(eg. if a network decides to add its own set of arguments in
a way incompatible with extended-join).
2020-06-12 19:11:15 +02:00
Valentin Lorentz
dd865583e7 NickAuth: cleanups. 2020-06-12 18:49:02 +02:00
Valentin Lorentz
2ceb60762e Seen: Don't internalize IrcString (again). 2020-06-05 00:41:18 +02:00
Valentin Lorentz
aa2f9202ec Google: Fix false positives on embedded thumbnails (eg. Youtube results). 2020-05-28 19:07:08 +02:00
Valentin Lorentz
847e51a7ec plugins: Fix name mismatch of typeSubstitution in getCommandHelp.
Bug introduced in 4046a1b201.
2020-05-27 21:19:09 +02:00
Valentin Lorentz
8b9ac3540d plugins: Fix AttributeError in getCommandHelp.
Introduced in commit 4046a1b201.
2020-05-27 20:30:39 +02:00
Valentin Lorentz
2924845de4 Google: Update, with a proper HTML parser.
Hopefully it will be more robust than the regexp.
2020-05-24 18:57:27 +02:00
Valentin Lorentz
ed87de1527 Filter: add support for upper-case letters. 2020-05-23 13:32:26 +02:00
Valentin Lorentz
b4d21127b1 Filter: Add uwu. 2020-05-23 12:10:40 +02:00
Valentin Lorentz
dde35a844d Seen: Don't internalize IrcString.
It's a bug, and it would mess case-insensitive comparison anyway.
2020-05-22 08:38:42 +02:00
James Lu
ac4ca4950d DDG: update plugin metadata 2020-05-21 23:11:38 -07:00
James Lu
2b567c5ef9 Owner: remove obsolete note about stock plugins on ImportError
Limnoria has not run 2to3 as part of the build process for many years now.

This reverts part of 1b2617bf8e.
2020-05-21 23:06:20 -07:00
Valentin Lorentz
2682e4cb48 Seen, ChannelUserDictionary: Internalize channel names.
They are not many of them, but they are used a lot so they take
up a surprising amount of memory.
2020-05-17 21:09:00 +02:00
Valentin Lorentz
08f4c781cb ChannelLogger: Make relayed message rewriting optional. 2020-05-17 21:05:59 +02:00
Valentin Lorentz
75f7479bf4 Config: Fix name clash with the expected 'reset' method. 2020-05-17 12:46:46 +02:00
Valentin Lorentz
2fe9bedb86 Fediverse: Remove nick prefix from snarfer output. 2020-05-16 23:15:11 +02:00
Valentin Lorentz
83c49ec43a Fediverse: black 2020-05-16 23:14:46 +02:00
Valentin Lorentz
6cc3d3080c Config: mention 'reset channel' and 'reset network' in setdefault's help.
Closes GH-680.
2020-05-16 10:20:43 +02:00
Valentin Lorentz
27f4386279 Config: Add commands 'reset channel' and 'reset network'.
They allow reseting a channel-specific or network-specific value
back to their parent value, and will follow it when it changes.
2020-05-16 10:15:31 +02:00
Valentin Lorentz
0bfd82f650 DDG: Add missing copyright notice. 2020-05-15 21:36:31 +02:00
Valentin Lorentz
d05b6e120b DDG: Remove note about dependency on BeautifulSoup. 2020-05-15 21:35:16 +02:00
Valentin Lorentz
10df0a0dd0 DDG: Rewrite using html.parser.HTMLParser instead of BeautifulSoup.
So we don't depend on an external library.
2020-05-15 21:26:44 +02:00
Valentin Lorentz
37c1fa2153 DDG: add test 2020-05-15 21:24:43 +02:00
Valentin Lorentz
5e90044fab DDG: Make tests honor --no-network. 2020-05-15 21:24:01 +02:00
James Lu
db184f962b Merge DDG plugin from my repository
Add 'plugins/DDG/' from commit '410b51657aeb93b4836d62168a90b319677a45f1'

git-subtree-dir: plugins/DDG
git-subtree-mainline: 91381aec0f
git-subtree-split: 410b51657a
2020-05-15 11:32:43 -07:00
Valentin Lorentz
f8a14547f9 Google: Update regexp. 2020-05-15 19:56:36 +02:00
Valentin Lorentz
ddce09d257 Rename supybot.reply.format.databaseRecord to supybot.replies.databaseRecord. 2020-05-15 19:08:43 +02:00
Valentin Lorentz
376917b1b8 Fediverse: Show attachment URLs. 2020-05-15 18:51:19 +02:00
Valentin Lorentz
6f4e3a2dbd QuoteGrabs: Add support for +draft/reply to point to the message to grab. 2020-05-15 18:17:34 +02:00
Valentin Lorentz
a54db1034f Fix Python 3.4 support. 2020-05-14 21:49:56 +02:00
Valentin Lorentz
eaf7222509 Fediverse: Cache host support for webfinger before snarfing.
This is much cheaper both for us and the host if the host
doesn't support activitypub at all (which is what happens
most of the time).
2020-05-14 21:33:34 +02:00
Valentin Lorentz
566920070c Fix regressions in 4046a1b201. 2020-05-14 19:00:31 +02:00
Valentin Lorentz
7444e656d8 supybot.reply.format.databaseRecord: Add $nick 2020-05-14 18:56:20 +02:00
Valentin Lorentz
4046a1b201 ChannelIdDatabasePlugin: Make the format of showRecord() configurable. 2020-05-14 18:45:04 +02:00
Valentin Lorentz
9e57913674 plugins/__init__.py: internationalize strings. 2020-05-14 18:42:22 +02:00
Valentin Lorentz
e90b89f5b2 Owner: Honor supybot.reply.error.detailed on command syntax errors. 2020-05-13 19:58:06 +02:00
Valentin Lorentz
a9eb31f1b5 Scheduler: Preserve network across restarts. 2020-05-12 18:32:37 +02:00
Valentin Lorentz
27edb4f6c9 Fediverse: Lower timeout of networkless tests.
There are many calls to assertSnarfNoResponse, so there's a lot
of time wasted sleeping, while these commands are fast enough
to answer in less than 0.1s
2020-05-10 21:42:41 +02:00
Valentin Lorentz
dc2fe4d5f3 Fediverse: Deduplicate username formatting and add some error handling. 2020-05-10 21:39:15 +02:00
Valentin Lorentz
2c9e6544f5 Fediverse: Add @status. 2020-05-10 21:12:05 +02:00
Valentin Lorentz
4e74c6dbb3 Fediverse: Make URL snarfer take precedence over Web. 2020-05-10 16:19:13 +02:00
Valentin Lorentz
6ea8b6bb31 Fediverse: Move test data to its own module. 2020-05-10 15:11:10 +02:00
Valentin Lorentz
d1854cfc9b Fediverse: Add URL snarfer. 2020-05-10 14:52:55 +02:00
Valentin Lorentz
5908b86635 Fediverse: Add option format.statuses.showContentWithCW 2020-05-10 13:37:40 +02:00
Valentin Lorentz
a52e7fa91b Fediverse: Show content warnings. 2020-05-10 13:04:01 +02:00
Valentin Lorentz
7511984a60 Fediverse: Fix compatibility with Python 3.4 and 3.5. 2020-05-10 11:21:08 +02:00
Valentin Lorentz
27219409b4 Fediverse: Document how to enable HTTP signatures. 2020-05-10 11:17:35 +02:00
Valentin Lorentz
ec1b1be8ff Fediverse: Add proper tests. 2020-05-10 10:44:56 +02:00
Valentin Lorentz
759fca5eba Switch names of TimeoutDict and ExpiringDict.
For consistency, as TimeoutQueue has guaranteed deletion after the timeout,
like the new TimeoutDict (ex-ExpiringDict).
2020-05-10 08:42:25 +02:00
Valentin Lorentz
d205a9b5f8 Fediverse: Use ExpiringDict instead of TimeoutDict for the cache, it guarantees expiry after the timeout. 2020-05-10 08:34:36 +02:00
Valentin Lorentz
cf2142ddd2 Fediverse: Sign headers Date and Host to prevent replays. 2020-05-09 22:18:03 +02:00
Valentin Lorentz
fd702a6a92 Fediverse: Add @statuses command. 2020-05-09 21:39:58 +02:00
Valentin Lorentz
4f027f2cbf Config: Add @searchhelp, to search in the help string of config vars and groups. 2020-05-09 21:07:23 +02:00
Valentin Lorentz
ba0738c540 Fediverse: Generate instance key automatically. 2020-05-09 20:55:57 +02:00
Valentin Lorentz
d5e241cb0c Fediverse: run Black. 2020-05-09 20:55:28 +02:00
Valentin Lorentz
e9ff57a1c9 Fediverse: Add usernameSnarfer. 2020-05-09 20:47:11 +02:00
Valentin Lorentz
76950126b5 Fediverse: Fix Python 3.4 compatibility. 2020-05-09 20:42:38 +02:00
Valentin Lorentz
79f13f3051 Fediverse: Add @featured command. 2020-05-09 20:29:24 +02:00
Valentin Lorentz
cb679d8599 Fediverse: Bug fixes. 2020-05-09 20:29:05 +02:00
Valentin Lorentz
d20bdbb5b7 Fediverse: Remove test @post command. 2020-05-09 19:29:00 +02:00
Valentin Lorentz
70fa18d155 Fediverse: Better error on unknown profile. 2020-05-09 19:28:37 +02:00
Valentin Lorentz
e87a14826e Fediverse: First draft. 2020-05-09 19:27:34 +02:00
Valentin Lorentz
bd1d7c9fa1 Config: Add @searchvalues. 2020-05-08 22:02:05 +02:00
Valentin Lorentz
b07376d16f Config: Exclude network pseudo-vars from @search. 2020-05-08 22:02:05 +02:00
Valentin Lorentz
428f5ca5dc Misc: Show a basic help when @help is called without an argument and customHelpString isn't set. 2020-05-08 12:37:07 +02:00
Valentin Lorentz
d627ba7683 Scheduler: Make @list show period and time before next run. 2020-05-06 18:15:53 +02:00
Valentin Lorentz
482658529b Scheduler: Add --delay option, to add an offset before the first run.
Closes GH-397.
2020-05-02 20:02:06 +02:00
Valentin Lorentz
ad05468257 Scheduler: Preserve period offset on restarts.
Partial fix for GH-397.
2020-05-02 18:28:41 +02:00
Valentin Lorentz
3ecc18e659 Scheduler: Add persistence tests. 2020-05-02 17:37:46 +02:00
Valentin Lorentz
ecc2c32950 Add support for storing STS policies.
If on an insecure connection: reconnect.
If on a secure connect: store it and do nothing else.

For now, stored STS policies are not read when connecting to an
insecure server.
2020-05-01 19:46:19 +02:00
Valentin Lorentz
3eb20adaf2 Fix extra arguments to irc.reply() being ignored by messages returned by '@more'.
This change builds all the ircmsg objects directly in irc.reply, with
the original arguments.

A side effect is that if a config var is changed between the initial command
call and the call to '@more', this commit makes it use the old values,
but that shouldn't be too much of an issue.

Closes GH-1405.
2020-04-11 16:40:07 +02:00
Valentin Lorentz
5e91a68ab0 Misc: Fix drop of the last (nb_mores % plugins.Misc.mores) messages.
If the last batch had less than plugins.Misc.mores messages;
getting the last messages of the batch would raise an IndexError,
causing the whole batch to be dropped.
2020-04-11 16:36:14 +02:00
Valentin Lorentz
f19079c75e Misc: rewrite @more tests to fully check the output.
This uncovered a few bugs; next commits will fix them.
2020-04-11 16:09:24 +02:00
Valentin Lorentz
37a7029618 SedRegex: when looking up config vars, strip statusmsg prefix from channel, and use network name for lookup. 2020-04-11 15:04:11 +02:00
Valentin Lorentz
0b0da9716d callbacks: honor network-specificity of supybot.reply.whenAddressedBy.
A side-effect is that plugins should now pass 'irc' instead of 'irc.nick'
when they call 'callbacks.addressed()'.
2020-04-11 15:00:46 +02:00
Valentin Lorentz
2953126fca test: Make assertNoResponse default to a non-zero timeout for threaded plugins.
Else it doesn't reliably check there is no response.
2020-04-11 00:17:16 +02:00
Valentin Lorentz
7e48ba0ba8 SedRegex: Use assertSnarfNoResponse instead of assertNoResponse.
assertNoResponse was only passing by accident on faster machines.
2020-04-11 00:16:01 +02:00
Valentin Lorentz
2bbd43fd85 ChannelStats: Skip checks of nick in irc.state.channels[channel] when channel databases are linked.
It crashes with KeyError because databases.plugins.channelspecific sets
channel='#', which is a non-existent channel.
And it doesn't make sense to check for presence in channel if the DB is
shared between all channels anyway.
2020-04-07 21:20:01 +02:00
James Lu
c212ee0e5e SedRegex: allow matching text with the trailing suffix missing
From: 866875ec5d
2020-04-02 10:00:40 -07:00
James Lu
c399272173 SedRegex: make callback matching case sensitive
This fixes a TypeError issue mentioned in d296bbb949.
2020-04-02 10:00:39 -07:00
James Lu
13c03716c5 Revert "SedRegex: Make pattern case-insensitive."
This reverts commit d296bbb949.
2020-04-02 09:47:32 -07:00
Valentin Lorentz
d296bbb949 SedRegex: Make pattern case-insensitive.
To fixes a mismatch between callbacks, which use flags=re.I by default,
and SED_REGEX.search which isn't; so 'S/foo/bar/' errored because it
matches case-insensitively so _unpack_sed is entered, but then _unpack_sed
fails to match it case-sensitively.
2020-04-02 17:30:57 +02:00
Valentin Lorentz
e2d72c5a43 Fix msgfmt warnings. 2020-03-26 22:10:28 +01:00
Valentin Lorentz
246925acce Relay: Add missing 'network' argument.
Broken since c1ae3f5c81.
2020-03-25 20:56:24 +01:00
James Lu
487897e7cc PluginDownloader: remove legacy name & python 2 branch of my repo 2020-03-20 16:37:15 -07:00
Valentin Lorentz
2f49362510 RSS: If ids are missing, use <link> as id. 2020-01-31 20:59:42 +01:00
Valentin Lorentz
653afdd086 RSS: Show a meaningful error in case '@rss' is called with a non-URL/name.
Instead of letting feedparser try to parse the name.
2020-01-28 19:35:05 +01:00
James Lu
d3b991895c SedRegex: skip testReDoSTimeout if multiprocessing is disabled 2020-01-27 08:00:46 -08:00
Valentin Lorentz
a6ae9f51a3 ChannelStats: Use the safe math evaluator. 2020-01-26 20:42:55 +01:00
Valentin Lorentz
99dd6f1506 core/Math: Move the math evaluator to src/utils/.
It will be used by ChannelStats.
2020-01-26 20:42:55 +01:00
Valentin Lorentz
5c10bea7aa Math: Fix log/log10 return type.
They used to always return complex numbers, instead of floats on float argument.
2020-01-26 20:42:55 +01:00
James Lu
4528a847e4 Aka, Google, String: fix more DeprecationWarning in tests (#1328) 2020-01-26 11:31:28 -08:00
James Lu
358c3a741f Channel: fix typo from 772862d49c 2020-01-26 11:22:51 -08:00
James Lu
304125cfd0 AutoMode, Channel, Nickometer: fix invalid escape sequence DeprecationWarning 2020-01-26 11:20:39 -08:00
James Lu
772862d49c plugins: use r'' strings to fix DeprecationWarning in test cases (#1328) 2020-01-26 11:14:25 -08:00
James Lu
ff899f5158 Aka, Debug: cleanup imports 2020-01-26 10:42:43 -08:00
Valentin Lorentz
9ab908759a Use importlib instead of imp.
importlib is deprecated.
2020-01-26 12:00:08 +01:00
Valentin Lorentz
9891b0fca4 Replace failUnless/failIf with assertTrue/assertFalse.
The old names are deprecated.
2020-01-26 11:14:18 +01:00
Valentin Lorentz
e7553dcca4 Add subcommand dispatching for CAP/FAIL/WARN/NOTE. 2020-01-23 14:25:10 +01:00
Valentin Lorentz
c457b52067 Deduplicate setting Accept-Language HTTP header.
This adds a new function conf.defaultHttpHeaders that can be used by plugins
to get all the default HTTP headers for a given network/channel.
2020-01-14 19:03:12 +01:00
Tasos Sahanidis
ae5ad2ceab Web: Implement protocols.http.requestLanguage 2020-01-14 18:48:11 +01:00
Tasos Sahanidis
7bd68df8aa Fix getSpecific usage
The channel and network arguments were incorrectly swapped
2020-01-12 10:35:35 +01:00
Valentin Lorentz
0fccea30ce Import MutableMapping and MutableSet from collections.abc.
Aliases in collections itself are removed in 3.8.
2020-01-09 01:11:12 +01:00
James Lu
d080edce00 Readd Limnoria name to default part & quit messages
This was removed in c930edd943
2020-01-04 11:17:57 -08:00
James Lu
51f10dbb60 SedRegex: update plugin metadata 2020-01-01 21:56:40 -08:00
James Lu
35dd3c3d9c Update plugin author/maintainer data
From: cbd953b32c
2020-01-01 21:55:58 -08:00
Valentin Lorentz
08764b85ef SedRegex: spawn a single process to handle the whole history.
This is more efficient than spawning up to 1000 processes (assuming
Limnoria's default config).

From: ede85ca8b0
2020-01-01 21:55:58 -08:00
James Lu
9e0db63b5b SedRegex: add test for ReDoS timeout
From: 81debc45ec
2020-01-01 21:55:58 -08:00
James Lu
1267d6452e SedRegex: abort when a search times out
This requires commit b54d8f8073, which separates the timeout and no match cases.

Also, raise the default processTimeout as the plugin now aborts on the first message that times out.

From: e5af479939
2020-01-01 21:55:58 -08:00
James Lu
43d4861577 Update my email & repo link references
From: 2ae51939b3
2020-01-01 21:55:58 -08:00
James Lu
6c54352713 SedRegex: test case normalization of channel names
From: 5672008a31
2020-01-01 21:55:58 -08:00
James Lu
937930ab6a SedRegex: match channel names case insensitively
Some IRCds (Unreal 3.2) don't mangle target names for case correctness, leading to a bug where users end up ignored by the plugin.

Reported by DOMF via IRC.

From: e19abe0498
2020-01-01 21:55:58 -08:00
James Lu
67a3928e4d SedRegex: log all errors, always display the not found mesage
From: fdab0edbc8
2020-01-01 21:55:58 -08:00
James Lu
06f70e59da SedRegex: reuse processTimeout in the sub() process too
From: 4e08442cde
2020-01-01 21:55:58 -08:00
James Lu
363285cfbf README: specifically mention that /s is specific to this plugin
[skip ci]

From: 5e6c9349fa
2020-01-01 21:55:58 -08:00
James Lu
e831d0e8ec SedRegex: make the regexp process timeout configurable
Although the default has been adequate on my systems, busy or low-powered machines may fail to process regexps quickly enough and cause SedRegex to sporadically error.

Reported by @cottongin via IRC.

From: 51ff41251b
2020-01-01 21:55:58 -08:00
James Lu
fd7aa571e9 SedRegex: remove compatibility workaround for Python 2.7.6 and lower
From: c9bcbbb934
2020-01-01 21:55:58 -08:00
James Lu
1646ca25c2 SedRegex: skip testBoldReplacement on Python 2
I don't know why it breaks here and I don't really care.

From: b9481184cb
2020-01-01 21:55:58 -08:00
James Lu
dcadb7e73b SedRegex: remove a duplicate test
From: 5e77c65a5f
2020-01-01 21:55:58 -08:00
James Lu
01e0c12641 SedRegex: use self.__class__ instead of __class__ in tests (Python 2 compat)
From: b53e6e40a0
2020-01-01 21:55:58 -08:00
James Lu
b01c50cd4d SedRegex: add a bunch of test cases
Closes #53.

From: a58785fa4a
2020-01-01 21:55:58 -08:00
James Lu
f40d8c530f SedRegex: bump copyright year to 2017
From: 0ef8138ab3
2020-01-01 21:55:58 -08:00
James Lu
90ec8a6976 SedRegex: fix some replacement queries not working
From: 926454b01d
2020-01-01 21:55:58 -08:00
James Lu
6445e90ec7 SedRegex: also catch errors in the regexp_wrapper() step
E.g. sre_constants.error: invalid group reference

From: e137d29eb9
2020-01-01 21:55:58 -08:00
James Lu
5370296bbf SedRegex: log the exact error name instead of "SedRegex error"
From: 406d7b1790
2020-01-01 21:55:58 -08:00
James Lu
dee2b6bdb3 SedRegex: require ending delimiter to prevent overzealous matching of replacement text
Closes #59.

From: 414a4a4a16
2020-01-01 21:55:58 -08:00
James Lu
656d2172db SedRegex: work around "nothing to replace" errors on < Python 2.7.6 again
From: 244a8c6bee
2020-01-01 21:55:58 -08:00
James Lu
889c6a1615 SedRegex: fix flag matching
From: db125ee5d1
2020-01-01 21:55:58 -08:00
James Lu
c1c423cc0d SedRegex: add configuration / usage instructions
From: 9d0dce6ef5
2020-01-01 21:55:58 -08:00
James Lu
24ae250ac4 SedRegex: implement 's' regex flag to only match the caller's message
From: 87c79db3d0
2020-01-01 21:55:58 -08:00
James Lu
bd0b1158fc SedRegex: allow free form flags and return them in _unpack_sed()
From: 423da9f996
2020-01-01 21:55:58 -08:00