Commit Graph

3888 Commits

Author SHA1 Message Date
Valentin Lorentz
1b4205f1ac registry: Fix comment about high-cardinality values. 2020-05-16 00:35:16 +02:00
Valentin Lorentz
2eb32de26e registry: Hide warning when channel is 'global'. 2020-05-16 00:32:28 +02:00
Valentin Lorentz
f408f6cc42 registry: Prevent memory leaks caused by Value.getSpecific getting values with non-channel/non-network values. 2020-05-16 00:04:10 +02:00
Valentin Lorentz
7e7a7bf936 registry: Explain why Value.set sets self._wasSet. 2020-05-15 23:56:39 +02:00
Valentin Lorentz
eead5566e5 utils.gen: set __slots__.
We create *a lot* of these structs, so it saves a considerable
amount of space.
2020-05-15 22:57:35 +02:00
Valentin Lorentz
ddce09d257 Rename supybot.reply.format.databaseRecord to supybot.replies.databaseRecord. 2020-05-15 19:08:43 +02:00
Valentin Lorentz
3d1e88cb68 safeEval: Get rid of eval().
It should be safe considering the AST sanity checks,
but I don't see any point in keeping it.
2020-05-15 18:31:04 +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
dc736799b8 callbacks: Prevent passing 'value' as positional argument to registryValue.
In case we need to add other arguments in the future.
2020-05-14 18:43:54 +02:00
Valentin Lorentz
0c6b526fdd Add -scheduler.repeat to default capabilities.
It's too easy to use to flood.
2020-05-13 20:16:35 +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
5c5cad5851 httpserver: Fix circular dependency when servers.http.keepAlive is true. 2020-05-09 22:17:28 +02:00
Valentin Lorentz
e87a14826e Fediverse: First draft. 2020-05-09 19:27:34 +02:00
Valentin Lorentz
43a8724d3a Don't strip spaces when parsing registry values.
It breaks plugins.Messageparser.listSeparator, and probably others.
2020-05-08 22:18:27 +02:00
Valentin Lorentz
e990ffa30c Add long_description from a plugin's README.md 2020-05-08 22:02:05 +02:00
Valentin Lorentz
f54588f9dd Add a 'limnoria.plugins entrypoint, to discover plugins installed via pip/setuptools. 2020-05-08 22:02:05 +02:00
Valentin Lorentz
f18eafc8d8 Fix crash on simulated echos (they don't have a prefix set). 2020-05-08 11:57:02 +02:00
Valentin Lorentz
83a8afde16 Add experimental support for +draft/reply client capability on outgoing messages. 2020-05-07 21:17:55 +02:00
Valentin Lorentz
eb1e27e20b Add echo messages, either with the echo-message capability or simulated.
Plugin can opt in to getting echo messages by setting the class attribute
'echo_message = True' if they want to get echos.
This defaults to False in order not to break existing plugins, and because
they usually don't need it (there's outFilter for most cases).
2020-05-07 21:08:07 +02:00
Valentin Lorentz
572c609181 Add labels to outgoing messages when labeled-response is supported.
This is going to be useful for implementing echo-message; and to plugins
targetting only networks with labeled-response support.
2020-05-07 20:56:59 +02:00
Valentin Lorentz
bb063b8064 Check server_tags in IrcMsg.__eq__. 2020-05-07 18:38:18 +02:00
Valentin Lorentz
307a2367f4 Don't add line breaks in the middle of capability names. 2020-05-07 18:38:18 +02:00
Valentin Lorentz
fc06aa72a6 Fix parsing ISUPPORT MODES with empty value. 2020-05-07 18:38:18 +02:00
Valentin Lorentz
2008f7b815 Exclude server_tags from truncation.
They have their own 8191 bytes.
2020-05-07 18:38:17 +02:00
Valentin Lorentz
da328b4985 Expire batches that never ended to avoid leaking memory. 2020-05-06 20:39:21 +02:00
Valentin Lorentz
cc0af4e790 Include start and end messages in a batch.
They may have useful server tags (especially when we start
supporting labeled-response).
2020-05-06 18:29:17 +02:00
Valentin Lorentz
a58c994954 Negotiate the 'setname' capability.
We don't store the name anywhere, but it can be useful to plugins.
2020-05-05 19:56:24 +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
fc4cc956ba Merge branch 'sts' into testing 2020-05-02 17:10:13 +02:00
Valentin Lorentz
01dcbf412b Fix edge case of server tags unescaping, when the backslash is followed by an 'invalid' char. 2020-05-01 23:46:34 +02:00
Valentin Lorentz
e92156711b Only spaces are token separators, not all whitespaces. 2020-05-01 23:44:38 +02:00
Valentin Lorentz
1854d86476 Add support for outputting server tags.
Will be useful when we start sending client tags.
2020-05-01 23:35:52 +02:00
Valentin Lorentz
309fc1233b Add postTransition method to IrcCallback, called when irc.state.fsm changes. 2020-05-01 20:19:53 +02:00
Valentin Lorentz
f7130f2629 Add missing transition trigger on MOTD start. 2020-05-01 20:19:00 +02:00
Valentin Lorentz
22120ee862 Fix various issues with STS handling. 2020-05-01 19:46:19 +02:00
Valentin Lorentz
51ff013fcc Apply STS policies when connecting to a server. 2020-05-01 19:46:19 +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
ff5edd95a3 Remove Twisted.
There's no reason to use it anymore instead of Socket.
It's already missing features compared to Socket, and I don't want to
maintain it anymore so it will keep getting worse.
2020-05-01 19:46:19 +02:00
Valentin Lorentz
45ff70907f [WIP] Start reworking Irc around a FSM.
To keep track of connection state instead of a complex implicit flow
between handling functions.
2020-05-01 19:43:27 +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
61b47bb65b Deduplicate list of arguments of _makeReply. 2020-04-11 16:36:14 +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
c489d2e9be Prevent getChannelDb from overriding state.channel set by getChannel.
I don't see any use for this; and it means a 'channel' converter
called after 'channeldb' returns '#' instead of the actual channel
if it's after 'channeldb' in the arg list and
databases.plugins.channelspecific is False.
2020-04-07 21:20:01 +02:00
Valentin Lorentz
712d8c2eab Remove debug print
Was added in 8bb31a54e7.
2020-03-26 10:29:42 +01:00
Valentin Lorentz
de77ce6ddc Raise exception instead of assert... 2020-03-21 02:21:06 +01:00
Valentin Lorentz
3576503e3f Update links to the documentation. 2020-03-17 19:22:52 +01:00
Valentin Lorentz
8f001f8045 Check spec.loader is not None when importing a plugin. 2020-02-09 16:02:35 +01:00