3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 19:49:24 +01:00
Commit Graph

205 Commits

Author SHA1 Message Date
James Lu
739c87ef50 clientbot: only split /names replies by spaces
This fixes issues with colored hostnames because \x1f is treated as a whitespace char by str.split().

Closes #641.

(cherry picked from commit 9056799633)
2019-04-08 22:36:28 -07:00
James Lu
298913200c clientbot: properly handle cases when the bot is told to kick itself
- Treat kicks to the PyLink client as a real user kick instead of a virtual one
- Forward on kick hooks if the PyLink client is kick target - this allows things like autorejoin to work

Closes #377.
2018-08-25 01:14:26 -04:00
James Lu
9cf507183d clientbot: filter PART hooks for only parts we didn't initialize
This fixes Relay being confused by its own "Relay plugin unloaded" /part's, and makes Clientbot's behaviour in this regard consistent with other protocols.
2018-07-18 19:14:47 -07:00
James Lu
76c0db15c4 core: merge TLS validation code into IRCNetwork (#592)
Certificate verification is now enabled for all Clientbot networks, but not yet for S2S links (self-signed certs are common here and direct IP links even more so)
2018-06-15 15:29:15 -07:00
James Lu
4524aebbac clientbot: initial pass of TLS cert validation (#592)
This works OK, but we should make the validation options built-in instead of clientbot-specific.
2018-06-15 02:47:12 -07:00
James Lu
040b009fcb clientbot: ignore RPL_ENDOFBANLIST (368) responses for removed channels 2018-06-15 02:19:56 -07:00
James Lu
1b68bfadc6 coremods, plugins, protocols: drop now redundant allowAuthed=False in is_oper() calls 2018-06-11 23:56:44 -07:00
James Lu
31a0d36990 clientbot: ignore missing args in 324 / RPL_CHANNELMODEIS
Fixes #537.
2018-06-08 18:45:20 -07:00
James Lu
1ab5d614c0 protocols: convert user TS to an int when receiving new users (#594) 2018-05-26 16:26:14 -07:00
James Lu
f20fa5e995 Add User.get_fields(), and rework plugins to fix $nick broken expansions
User.nick is no longer a writable attribute since a085aed924, so it won't show up in __dict__ now.

get_fields() replaces the User.__dict__ hack various plugins used and also provides some new expansion variables:
- $sid and $server expand to the server ID and name respectively
- $modes and $channels are now preformatted strings
- $netname expands to the network name

$manipulatable and $_irc were removed since their values aren't quite meaningful as strings
2018-05-26 02:12:38 -07:00
James Lu
3120fa5396 clientbot: stop sending duplicate JOIN hooks
Also set _clientbot_initial_who_received on 315/ENDOFWHO, instead of on the first /who response we get.

Really fixes #551.
2018-05-09 22:31:19 -07:00
James Lu
451db74f0c clientbot: don't send duplicate away statuses 2018-05-09 22:23:14 -07:00
James Lu
f54382534c kick and kill should raise NotImplementedError when not supported by a protocol
Closes #605.
2018-05-09 22:19:03 -07:00
James Lu
8eba402a33 clientbot: drop pre-WHO join bursting with userhost-in-names, it's too unreliable
Closes #602.
Closes #551.
2018-04-24 12:39:29 -07:00
James Lu
9e212fc0a4 protocols: migrate utils.wrapArguments, splitHostmask use to camel case (#523) 2018-03-02 20:23:47 -08:00
James Lu
804791b8af clientbot: support expansions ($nick, etc) in autoperform 2018-02-20 23:19:32 -08:00
James Lu
37be73d39c clientbot: add STATUSMSG support (#570) 2018-02-18 22:15:19 -08:00
James Lu
ea84497359 protocols: remove the endburst_delay option from spawn_server
Interestingly, this was never documented in the protocol module spec...
2018-02-10 15:44:09 -08:00
James Lu
18c1a277f5 clientbot: remove extraneous use of to_lower() in handle_part 2018-01-31 19:35:24 -08:00
James Lu
74848853ac clientbot: fix KeyError caused by lower() in spawn_server
This affected connections to afternet for example.
2018-01-31 19:33:05 -08:00
James Lu
958bb351ca clientbot: log warnings if the bot cannot join a channel
Closes #533.

This adds handlers for the following numerics:
* ERR_TOOMANYCHANNELS (405)
* ERR_CHANNELISFULL (471)
* ERR_INVITEONLYCHAN (473)
* ERR_BANNEDFROMCHAN (474)
* ERR_BADCHANNELKEY (475)
* ERR_BADCHANMASK (476)
* ERR_NEEDREGGEDNICK (477)
* ERR_BADCHANNAME (479)
* ERR_SECUREONLYCHAN / ERR_SSLONLYCHAN (489)
* ERR_DELAYREJOIN (495)
* ERR_OPERONLY (520)
2017-12-22 12:28:27 -08:00
James Lu
509c2e52c4 clientbot: fix KeyError when there are still queued outgoing messages to a channel we just left 2017-11-05 01:17:59 -08:00
James Lu
544e078512 clientbot: treat 0 as an empty account name (for WHOX)
This fixes incorrect "X is logged in (on somenet) as 0" messages in WHOIS.
2017-10-25 16:01:10 -07:00
James Lu
66c762b63f Merge remote-tracking branch 'origin/clientbot-fixes' into devel 2017-10-10 20:53:12 -07:00
James Lu
25ec88c566 clientbot: don't send empty MODE hooks when enumerating empty ban lists 2017-10-07 21:51:38 -07:00
James Lu
eca40a3d7c coremods/handlers: implement cleanup code for visible-state-only servers
Closes #536.
Closes #517.
2017-10-07 21:49:17 -07:00
James Lu
de5ab051aa clientbot: rename cap. clear-channels-on-leave => visible-state-only (#517) 2017-10-07 21:48:48 -07:00
James Lu
740b399ec2 clientbot: block attempts from virtual clients to change to an existing nick (#535) 2017-10-07 20:50:09 -07:00
James Lu
d7766d54d5 clientbot: check for nick collisions with virtual clients on NICK
Closes #535.
2017-10-07 20:07:26 -07:00
James Lu
84ff797b5f clientbot: rewrite _get_UID nick collision handling to be less confusing 2017-10-07 20:03:25 -07:00
James Lu
76a0eb78e3 clientbot: fix possible TypeError in squit() 2017-09-23 21:54:42 -07:00
James Lu
a2a32ed32f clientbot: wrap outgoing modes to prevent cutoff 2017-09-23 21:54:02 -07:00
James Lu
6e89dbed24 clientbot: implement ban list enumeration on JOIN
Closes #530.
2017-09-23 21:26:13 -07:00
James Lu
5112fcd7d1 clientbot: warn when an outgoing message is blocked
Closes #497.
2017-09-02 21:46:35 -07:00
James Lu
8170e777e8 protocols: move setting irc.connected to endburst 2017-08-30 19:39:57 -07:00
James Lu
c4a3baca7d protocols: switch to self.is* 2017-08-28 20:07:36 -07:00
James Lu
2a7594e56e Move PUIDGenerator->classes, IncrementalUIDGenerator->ircs2s_common (#476) 2017-08-28 19:42:24 -07:00
James Lu
8c0f19422f core: Add irc argument to User and Server classes
Also, add a __deepcopy__ override to channel because we cannot clone IRCNetwork objects (locks cannot be pickled).
2017-08-25 13:53:45 -07:00
James Lu
96a202acce core: make User.channels use IRCCaseInsensitiveSet
Closes #515. This is an API breaking change!
2017-08-25 13:26:34 -07:00
James Lu
80766e051e core: define two (joined) versions of the channels index
Closes #509.

PyLinkNetworkCore.channels is split into the following:
- irc._channels which implicitly creates channels on access (mostly used in protocol modules)
- irc.channels which does not (recommended for use by plugins)
2017-08-25 02:12:08 -07:00
James Lu
a02fa45d96 clientbot: use existing fallback hostname abstraction instead of hardcoding it separately 2017-08-24 01:12:45 -07:00
James Lu
903f86a342 clientbot: add extended-join support (#290) 2017-08-23 19:28:10 -07:00
James Lu
abdc67e0c1 clientbot: track numeric 900 (RPL_LOGGEDIN) and set our own account name
This is mostly for completeness.
2017-08-23 19:19:53 -07:00
James Lu
c9f10796ee clientbot: move services account setting bits into a shared function 2017-08-23 19:16:20 -07:00
James Lu
c2fc9080cc clientbot: don't send JOIN hooks for the bot itself when receiving JOIN
Closes #519.
2017-08-23 19:11:15 -07:00
James Lu
bd6272abf6 clientbot: add a dummy internal host for the clientbot bot... 2017-08-21 23:28:10 -07:00
James Lu
060a947798 clientbot: whoops, fix wrong arg count for WHOX services acc handling 2017-08-21 23:27:47 -07:00
James Lu
0bb4a35c6f Support pre-auth irc.pseudoclient enumeration & configurable altnicks
Closes #516. Closes #288.
2017-08-21 23:05:56 -07:00
James Lu
6981869c06 clientbot: split up join() and handle_join() to prevent duplicate JOIN/MODE/WHO on connect 2017-08-20 19:24:46 -07:00
James Lu
81f3112d01 clientbot: use WHOX where available to fetch account names on join 2017-08-20 18:49:07 -07:00