Commit Graph

5790 Commits

Author SHA1 Message Date
Valentin Lorentz
f390ade16d Anonymous: Add CLIENTTAGDENY test 2021-03-18 20:28:15 +01:00
Valentin Lorentz
ac0d7952a7 Anonymous: Add @react command
Gated behind supybot.protocols.irc.experimentalExtensions, as usual.

Spec: https://ircv3.net/specs/client-tags/react
2021-03-18 20:20:09 +01:00
Valentin Lorentz
544f137c64 Anonymous: Simplify/modernize @internationalizeDocstring and var setting in test. 2021-03-18 19:56:30 +01:00
Valentin Lorentz
7861040c37 Merge branch 'logtoirc' into testing 2021-03-17 21:22:29 +01:00
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