Commit Graph

11859 Commits

Author SHA1 Message Date
Valentin Lorentz
ac84fa4d68 ircquote: Use labeled-response when possible to reply to the user 2023-06-08 19:55:47 +02:00
Tasos Sahanidis
6021f0e6d9
String: Display regex error on invalid group reference (#1537) 2023-06-04 12:51:27 -07:00
James Lu
416a05e326
Route commands from Network.command back to the original network (#1540)
Add a replyIrc parameter to ReplyIrcProxy to run a command on one network, but route the replies to another.
This fixes a long standing issue where replies for remote commands are often lost to the void, as the nick of the caller may not exist on the target network (or worse, it could belong to a completely unrelated person).

Closes GH-556.

Co-authored-by: Val Lorentz <progval+git@progval.net>
2023-06-04 12:39:56 -07:00
James Lu
654937ecfc botchk: move imports to top-level 2023-05-26 20:27:39 -07:00
Valentin Lorentz
21b7408ca8 ci: Bump Python 3.12 version 2023-05-21 19:01:40 +02:00
Valentin Lorentz
8859e1ce51 setup.py: Add Python 3.11 and 3.12 to classifiers. 2023-05-21 18:50:24 +02:00
James Lu
3be1804553 botchk: fix syntax error 2023-04-27 18:36:50 -07:00
Val Lorentz
1690839a26
Merge pull request #1532 from progval/entrypoints
Use setuptools 'entry_points' + add 'limnoria-*' CLIs in addition to 'supybot-*'
2023-04-27 20:52:17 +02:00
Valentin Lorentz
6f663e4140 Merge branch 'testing' into entrypoints 2023-04-26 18:04:21 +02:00
Valentin Lorentz
295798ac0e Stop testing pypy3.7 with optional dependencies
one of the dependencies stopped supporting it (probably 'cryptography'
as it's the only one not in pure-Python)
2023-03-24 20:49:14 +01:00
Valentin Lorentz
add9306d30 Socket: Clear buffers on reconnect 2023-03-24 20:23:32 +01:00
Valentin Lorentz
f518579c77 Request standard-replies capability
Arbitrary standard-replies are already supported, this signals to servers
that we do.
2023-02-21 19:10:11 +01:00
Valentin Lorentz
922b00c8c3 Fediverse: Use default headers
Some instances behind Cloudflare block requests without a User-Agent
header.
2023-01-28 13:00:16 +01:00
Valentin Lorentz
3f5a18e8d0 Remove unused import fallback on the 'mock' library 2023-01-21 18:51:17 +01:00
Valentin Lorentz
efed7d8081 Move the 'ignore=False' trick from callbacks to Scheduler
I fear putting it in callbacks would be overzealous and reset it
within the processing of the same message, eg. when using conditional
to set the 'ignore' tag before other nested commands run.
2023-01-19 10:31:13 +01:00
Valentin Lorentz
f409111872 callbacks: Fix interference between Scheduler.repeat, Anonymous, and nested commands
Specifically, the issue is with Anonymous using irc.noReply() in
the first call, preventing nested commands' result from being used.

Before this commit, the second and third responses in the test would be
only "1" and "2" instead of "1 ['foo']" and "2 ['foo']".
2023-01-19 10:19:01 +01:00
Valentin Lorentz
b42596a021 Regenerate READMEs 2023-01-12 22:24:16 +01:00
Valentin Lorentz
02a0204f80 Services: Improve doc of plugins.Services.nicks 2023-01-12 22:24:16 +01:00
Val Lorentz
f5d39b0be2
Skip irctest on pypy-3.9
For some reason, it takes a whole hour to run
2022-12-28 23:15:30 +01:00
Valentin Lorentz
ef960befa3 Add test for registry reloading 2022-12-28 17:06:02 +01:00
Valentin Lorentz
64b1469a23 ci: Bump Python versions 2022-12-28 15:12:54 +01:00
Valentin Lorentz
501770e544 Fediverse: Add support for missing host-meta document 2022-12-28 15:12:18 +01:00
James Lu
21a2ace7a1 Services: allow adjusting GHOST command
Anope 2.x has renamed this to /ns recover

Closes GH-1510
2022-12-24 08:53:26 +01:00
Valentin Lorentz
d372d55c05 ci: Make Ubuntu versions explicit
Github just migrated us to Ubuntu 22.04, but it can't run Python 3.6 on it
2022-12-23 22:33:59 +01:00
Valentin Lorentz
1a7c14f4b3 Web: Decode using the charset advertized in response headers
And fall back to the sniffing when not present
2022-11-26 09:06:47 +01:00
Valentin Lorentz
e6c4da0fff Channel: Fix and re-enable disabled tests 2022-11-23 19:25:22 +01:00
Valentin Lorentz
985ca23f71 Add tests for nicksToHostmasks 2022-11-23 19:25:12 +01:00
Valentin Lorentz
314fad36eb Modernize tests
Thanks to https://pypi.org/project/teyit/
2022-11-20 19:33:23 +01:00
Valentin Lorentz
fd248dc521 Channel: Fix documentation, --exact cannot be combined 2022-11-20 19:07:44 +01:00
Valentin Lorentz
d7d97d3b93 Google: Remove broken commands 2022-11-10 01:48:49 +01:00
James Lu
73a23e220f IrcState: fix typo in attribute docs
capabilities_acq -> capabilities_ack
2022-11-06 18:38:24 -08:00
Valentin Lorentz
4da1291876 URL: Lazily deserialize records from the end in @last
Before this commit, the plugin first fetched a list of all
(deserialized) records in a list, then reversed the list, and iterated
on the reverse list.
This proved to be slow, with most of the time being spent in
`dbi.DB._newRecord` (which essentially deserializes one list of CSV).

After this commit, the list is reversed first, then the plugin iterates
on its generator, which calls `_newRecord` on records as they are
requested.

This means that when there are many URLs in the database, `@last` does
not need to waste time deserializing most records, when the result is
near the end (and if the result is the first record, then it does
exactly as much work as before).
2022-10-30 20:46:35 +01:00
Valentin Lorentz
f4ac7f88fe RSS: Don't crash on invalid variable name
It's confusing not to have feedback on IRC when a variable name
is typoed.
2022-10-28 22:41:43 +02:00
Valentin Lorentz
77805ff36e irclib: Abort authentication when server fails SCRAM challenge
Will be tested by irctest:
https://github.com/progval/irctest/pull/179
2022-10-28 15:00:58 +02:00
Valentin Lorentz
e9a29e9159 irclib: Fix crashes on ecdsa/scram signature failures 2022-10-28 14:57:57 +02:00
Valentin Lorentz
b0525bcf42 Double default peekSize
We bumped it to 8kB in 2015, but it is starting to be an issue again.
2022-10-28 14:22:44 +02:00
Valentin Lorentz
2cfc821203 Web: Allow configuring higher peekSize on Youtube 2022-10-28 14:18:52 +02:00
Valentin Lorentz
009b900100 Make TimeoutQueue.iter() actually expire items
It is functionally fine not to, but causes objects to never be freed
if iter() is the only method called on the queue (ie. no
enqueue/dequeue, len(), ...)
2022-10-24 23:43:52 +02:00
Valentin Lorentz
2c5dc405fc test: Revert generic 'The Limnoria Contributors' in copyright notices
I forgot to include these in 63eb6672ea

(This is fine because noone but me touched these files since the initial
change in db7ef3f025).
2022-10-24 23:41:26 +02:00
Valentin Lorentz
47253e032e Add test for structures.TimeoutQueue.__iter__ 2022-10-24 23:21:11 +02:00
Valentin Lorentz
d0a484c11c Sort remaining nondeterministc sets of values
Closes GH-1516
2022-10-20 18:35:58 +02:00
Valentin Lorentz
dc94f8dc68 registry: Default to sorting sets of values
Not sorting them causes the config file to change when the bot writes
it, because order is nondeterministic.

This is usually fine, but can be annoying when configs are deployed
with Ansible.

Closes GH-1516
2022-10-14 23:15:11 +02:00
Valentin Lorentz
8c17505221 User: Sort output of @capabilities
It's more readable than a random order.
2022-10-13 21:46:50 +02:00
Valentin Lorentz
a6aa5530dd Ensure files written with AtomicFile are read in UTF8
With some locale configurations (not that uncommon on CentOS), open() may
default to non-UTF8 encodings (eg. ANSI_X3.4-1968).

This is usually not an issue, because we use open() both for writing and
reading. However, AtomicFile implicitly enforces UTF8; which needs to be
mirrored when reading.
2022-10-06 09:49:42 +02:00
James Lu
b1cfb87e71 String: allow multi-character inputs in "ord" and "unicodename"
This allows them to support emoji ZWJ sequences, which render like one character but are actually multiple.
2022-10-06 08:31:22 +02:00
Valentin Lorentz
35bf599856 utils/web: Add <br/> to the list of block elements
It should always be replaced with a space.
2022-09-20 07:51:46 +02:00
Valentin Lorentz
169824a9d2 Math: make @icalc fail early when result is too large
This avoids inconsistent errors between CPython 3.10.7 and older
versions; and the result would not be readable anyway.

Closes GH-1517.
2022-09-18 20:06:34 +02:00
Valentin Lorentz
acdae12bbd Bump CI version from 3.11.0-alpha.2 to 3.11.0-rc.2 2022-09-18 20:06:34 +02:00
Valentin Lorentz
bc3a441888 Poll: Make answers case-insensitive 2022-09-18 19:25:48 +02:00
Valentin Lorentz
200acdfa93 registry: Normalize values before checking they are valid
Otherwise, normalization is useless, and gives a surprising error message,
such as:

```
<user> config plugins.rss.sortfeeditems oldestfirst
<bot> Error: Valid values include 'asInFeed', 'oldestFirst', 'newestFirst', 'outdatedFirst', and 'updatedFirst', not 'oldestFirst'.
```
2022-09-07 12:31:22 +02:00