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

1085 Commits

Author SHA1 Message Date
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
a425f873b5 relay, inspircd: move endburst delay code to a private API
This is a very specific hack that shouldn't be extended across the protocol module spec. So far, all other protocol modules ignore the endburst_delay option anyways.
2018-02-10 15:34:07 -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
84f6190478 inspircd: only read METADATA modules changes from the uplink
Closes #567.
2018-01-25 09:52:29 -08:00
James Lu
6bb2198710 inspircd: move _modsupport.clear() to a _post_disconnect override
Speculative fix for #567.
This may be caused by a race condition between post_connect and handle_capab, since the remote server can send its server data before we start sending ours.
2018-01-21 13:27:59 -08:00
James Lu
043a147b41 p10: fix hashed cloaks check reading from the wrong config variable 2017-12-31 12:09:36 -08:00
James Lu
56fa626605 inspircd: use clear() instead of replacing the _modsupport set
Maybe this will fix issues with _modsupport not being completely filled?
2017-12-27 11:48:00 -08:00
James Lu
7c0d279f61 inspircd: raise NotImplementedError instead of only warning when a CHG* module is missing 2017-12-22 12:41:48 -08:00
James Lu
92427201f1 inspircd: track module (un)loading
Closes #555.
2017-12-22 12:38:48 -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
145a4677f6 ircs2s_common: add handling for nick@servername messages 2017-12-21 02:57:10 -08:00
James Lu
8dbbe65a1c ircs2s_common: remove useless statusmsg splitting code
We used to do this in order to lowercase the channel part of ~#channel messages correctly, but that is no longer needed as of 9702030bf5.
2017-12-21 02:11:28 -08:00
James Lu
f64976b1ed p10: implement outgoing knock() as a wrapper over NOTICE 2017-12-21 01:53:41 -08:00
James Lu
16b491fdab ts6_common, p10: declare protocol cap has-statusmsg 2017-12-21 01:34:41 -08:00
James Lu
20e730ba2b p10: add inbound handlers for WALLCHOPS/WALLHOPS/WALLVOICES
This essentially finishes off STATUSMSG support on P10.
2017-12-21 01:27:19 -08:00
James Lu
2cc1195ff9 p10: refactor message() to send @%+#channel messages correctly 2017-12-21 01:20:08 -08:00
James Lu
454539185e Move knock handling to ts6_common
This adds support for (reasonless) KNOCK on TS6.
2017-12-21 00:04:55 -08:00
James Lu
2245af1dba Revert "ts6: handle ChatIRCd ENCAP USERMODE"
This reverts commit 785fc8d2d2.

This feature isn't actually used yet and is relatively non-standard. Aside from that, the biggest issue so far is that ENCAP USERMODE doesn't give servers a way to explicitly acknowledge or reject(ignore) the mode change, which can lead to desyncs.
2017-12-18 17:20:37 -08:00
James Lu
ec3b230eab inspircd: move definitions for cmodes +J and +E to kicknorejoin_insp and repeat_insp
These use InspIRCd specific arguments which don't map cleanly to other IRCds. #559
2017-12-18 13:10:48 -08:00
James Lu
a0c57d0a5a unreal: register ~T extbans as filter and filter_censor (#557)
This doesn't work in relay yet because of #560 (as well as a restriction where acting extbans must match n!u@h...)
2017-12-07 00:36:38 -08:00
James Lu
80ef2ca788 hybrid: remove slash-in-hosts as it is not supported 2017-12-03 18:56:43 -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
b366aa8d61 Merge branch 'wip/ts6-updates' into devel 2017-10-27 06:50:37 -07: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
c974ee9b44 hybrid: various cleanup 2017-10-22 01:19:38 -07:00
James Lu
c636e064e7 ts6: remove SAVE from required capabs
We don't actually send SAVE out to any IRCd, so we don't need to demand that it's supported.

Closes #545.
2017-10-22 01:08:30 -07:00
James Lu
5e7469b56f Remove protocols/ratbox, superseded by ts6
Closes #543.
2017-10-22 01:06:55 -07:00
James Lu
975d835c92 ts6: add support for ratbox, send EUID only when supported (#543) 2017-10-22 01:00:12 -07:00
James Lu
1a24bc19af ts6: rename self.caps to self._caps 2017-10-22 00:44:30 -07:00
James Lu
3d3300e542 ts6: merge in CHGHOST checks and umode definitions from protocols/ratbox 2017-10-22 00:41:15 -07:00
James Lu
c2dbb74f5a ts6: clean up mode definitions and target_ircd code 2017-10-22 00:29:00 -07:00
James Lu
4935ef521e unreal: fix wrong hook name for legacy user introduction 2017-10-15 01:55:53 -07:00
James Lu
e8958962dd unreal: fix authentication-in-progress check in handle_server 2017-10-15 01:54:39 -07:00
James Lu
aa44bc15a3 classes: fix backwards sorting in Channel.sort_prefixes()
Also remove various workaround code added to address this.
2017-10-15 01:29:42 -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
e25f6fd470 ircs2s_common: expand PUIDs in squit()
This fixes SQUIT not working correctly on ngIRCd.
2017-09-23 23:15:29 -07:00
James Lu
f74b34e99b ts6: fix wrong prefix char for +a on ChatIRCd
This fixes users with +a disappearing when bursted to ChatIRCd.
2017-09-23 22:43:27 -07:00
James Lu
ad32ce20da protocols: send outgoing hop counts for servers and users
Closes #527.
2017-09-23 22:36:31 -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
42d62fe28a p10: pass IPv6 IPs on to supported servers
Closes #254.
2017-09-23 13:20:58 -07:00
James Lu
6dec4bd96f p10: fix wrong hook name for user introduction 2017-09-17 13:59:42 -07:00
James Lu
b9a4010acc Merge branch 'master' into devel
Conflicts:
	plugins/relay.py
2017-09-05 21:22:16 -07:00
James Lu
93704d85bf unreal: fix TypeError when a set is given for modes in mode() 2017-09-05 21:21:16 -07:00
James Lu
8420587318 clientbot: warn when an outgoing message is blocked
Closes #497.

(backported from commit 5112fcd7d1)
2017-09-05 18:53:33 -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
1f270c985f hybrid: drop EX and IE from required capabilities
This fixes compatibility with hybrid trunk, commit ircd-hybrid/ircd-hybrid@981c61e36c

(cherry picked from commit 30dc4a2b27)

Conflicts:
	protocols/hybrid.py
2017-08-31 15:07:04 -07:00
James Lu
a03214514c hybrid, ts6, ratbox: fix +p mode definitions properly
+p is noknock and rfc1459-style private on all 3 IRCds, though the latter bit is undocumented in /help cmodes (maybe it's assumed?)
+p is also "paranoia" on hybrid, which adds more restrictions to halfops and /invite

(cherry picked from commit c107f0062f)
2017-08-31 15:06:25 -07:00
James Lu
dd5a0c4892 ts6: fallback realhost to host, not None
(cherry picked from commit dfa90378df)
2017-08-31 14:57:28 -07:00
James Lu
74ae6fd7c0 p10: add support for nefarious2 extbans
Closes #524.
2017-08-31 14:52:03 -07:00
James Lu
2d2b524a63 ngircd: disable slash-in-nicks
This breaks user mode changes, as it is one of the only commands to undergo nick validation when received from a remote server.
2017-08-31 14:09:04 -07:00
James Lu
ac89f45683 ngircd: rework NJOIN code
- Fix "Internal NJOIN error"s caused by joining users already in the channel again
- Fix NJOIN being sent from the wrong internal server
- Condense two iterations over the user list into one
2017-08-31 13:17:28 -07:00
James Lu
8170e777e8 protocols: move setting irc.connected to endburst 2017-08-30 19:39:57 -07:00
James Lu
9a84dbde71 protocols: consistently track ENDBURST on sub-servers too 2017-08-30 19:18:39 -07:00
James Lu
4a363aee50 Move _expandPUID into PyLinkNetworkCoreWithUtils 2017-08-30 00:56:18 -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
1cdb5fc025 hybrid, ratbox: remove extban definitions 2017-08-25 12:24:09 -07:00
James Lu
cdb575236e inspircd: remove a useless and misformatted debug line 2017-08-25 02:13:15 -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
b214a8f4c0 unreal: fix wrong case in opertype extban 2017-08-24 00:55:55 -07:00
James Lu
1408622694 ts6: add definitions for inverted extbans as well 2017-08-23 23:23:28 -07:00
James Lu
c6ca89b48a Fill in the rest of the extbans list for inspircd & unreal (#498) 2017-08-23 21:47:43 -07:00
James Lu
de1a6379df Add (experimental) support for matching extbans (#498) 2017-08-23 21:18:57 -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
James Lu
55f50eb251 clientbot: don't send /NAMES on join, it isn't needed 2017-08-20 17:29:03 -07:00
James Lu
85f283c5f8 clientbot: add support for IRCv3.2 account-tag (#290) 2017-08-20 16:52:23 -07:00
James Lu
48c6765411 clientbot: add support for IRCv3.1 account-notify (#290) 2017-08-20 16:12:25 -07:00
James Lu
0bbe5d3a1a clientbot: add support for IRCv3 CHGHOST (#290) 2017-08-19 23:55:41 -07:00
James Lu
766450afd3 clientbot: add experimental userhost-in-names support (#290) 2017-08-19 23:23:19 -07:00
James Lu
471733bfd0 clientbot: track /who received status by user, not by channel 2017-08-19 22:29:08 -07:00
James Lu
72145e09b8 clientbot: implement away-notify support (#290) 2017-08-19 22:04:24 -07:00
James Lu
30dc4a2b27 hybrid: drop EX and IE from required capabilities
This fixes compatibility with hybrid trunk, commit ircd-hybrid/ircd-hybrid@981c61e36c
2017-08-11 15:09:53 -07:00
James Lu
c107f0062f hybrid, ts6, ratbox: fix +p mode definitions properly
+p is noknock and rfc1459-style private on all 3 IRCds, though the latter bit is undocumented in /help cmodes (maybe it's assumed?)
+p is also "paranoia" on hybrid, which adds more restrictions to halfops and /invite
2017-08-11 13:45:40 -07:00
James Lu
046fe0c385 protocols: add headers to modules where missing 2017-08-11 12:27:58 -07:00
James Lu
8df7b5319e Move handle_realhost/handle_login to ts6 2017-08-11 12:21:41 -07:00
James Lu
dfa90378df ts6: fallback realhost to host, not None 2017-08-11 12:19:23 -07:00
James Lu
785fc8d2d2 ts6: handle ChatIRCd ENCAP USERMODE
Per https://github.com/ChatLounge/ChatIRCd/blob/master/doc/technical/ChatIRCd-extra.txt
2017-08-11 12:15:05 -07:00
James Lu
4ec1727888 unreal: rewrite/condense usermode change handling to be more consistent
Consistently call _check_oper_status_change() and _check_cloak_change() through a _handle_umode() wrapper. Also, handle the real portion of the mode change given in SVS2MODE.
2017-08-11 12:03:56 -07:00
James Lu
e13f2fdbb0 unreal: remove obsolete note regaring server-sourced notices 2017-08-10 19:53:16 -07:00
James Lu
6a5ca6b508 Merge bits of handle_server into ts6_common 2017-08-10 19:50:32 -07:00
James Lu
d0f9a2465d Move handle_sid to ts6_common 2017-08-10 19:42:04 -07:00
James Lu
614b8b87da inspircd: rewrite handle_ping to handle one-arg PING 2017-08-09 16:55:02 -07:00
James Lu
5381e85d3c IRCS2SProtocol: fix wrong if: statement regarding user presence 2017-08-09 16:06:37 -07:00
James Lu
486a225156 inspircd: mark endburstf() threads as daemon=True
There is no reason whatsoever for this to even potentially block shutdown.
2017-08-08 00:27:05 -07:00
James Lu
64f05bd28b inspircd: set a name on endburstf() threads 2017-08-08 00:26:32 -07:00
James Lu
be41f57795 PyLink 2.0-dev, now with /stats support!
Closes #131.
2017-08-07 23:52:16 -07:00
James Lu
9702030bf5 protocols: continue removing to_lower() calls on channels (#372) 2017-08-07 21:54:33 -07:00
James Lu
b1b2394836 ircs2s_common: ignore PART for channels that the user wasn't on
These extra parts caused issues with relay when receiving P10 KICK acknowledgements as they are treated as if the user was already in the channel.
2017-08-07 00:05:44 -07:00
James Lu
99790bfae2 p10: remove direct usage of to_lower() for channels
Ref #372
2017-08-06 18:11:34 -07:00
James Lu
07fa53d128 protocols: remove direct usage of to_lower() for channels
Not needed as of 32249ace3e (ref #372)
2017-08-06 18:05:14 -07:00
James Lu
3c675bb163 inspircd, unreal: support the "block nick changes" extban
This is n: and ~n: on inspircd and unreal respectively.
2017-08-06 01:47:43 -07:00
James Lu
9ae851e1fc classes: rename NetworkCore.aborted to _aborted 2017-08-05 22:16:52 -07:00
James Lu
7db811f2dd protocols: declare quiet extban support where applicable 2017-08-05 21:52:34 -07:00
James Lu
981e6c508f Move _check_nick_collision to NetworkCoreWithUtils
This is useful for networks that emulate IRC as well, to prevent clashes between real clients and virtual ones.
2017-07-31 20:58:02 +08:00
James Lu
63f52ca8b0 ircs2s_common: handle 'netadmin' umodes as an oper type
Also, make the Network Service opertype take precedence over the others.
2017-07-20 20:03:32 +08:00
James Lu
19d41d7298 ngircd: add GLINE support
Also add IRCd notes regarding AllowRemoteOper and modeless channels.
2017-07-17 09:12:07 -07:00
James Lu
b1d5ca36fb hybrid: add KLINE support (#139) 2017-07-17 08:37:43 -07:00
James Lu
f56fae4bc9 unreal: implement GLINE support (#139) 2017-07-17 08:13:28 -07:00
James Lu
cc9025a080 p10: add GLINE support (#139) 2017-07-17 07:50:48 -07:00
James Lu
410ade3b60 ts6: implement KLINE support (#139) 2017-07-17 06:29:44 -07:00
James Lu
ab8a922809 inspircd: add GLINE support (#139) 2017-07-17 06:12:12 -07:00
James Lu
c7c29f35e5 core: make message cutoff optional, and disable for inspircd
Closes #490.
2017-07-16 21:01:55 -07:00
James Lu
1f377adfee p10: also acknowledge our own kicks with a PART
(adapted from commit 1438f9e566)
2017-07-16 07:34:45 -07:00
James Lu
880d0975db Merge branch 'type-to-isinstance' of https://github.com/cooper/PyLink into devel 2017-07-14 05:22:37 -07:00
James Lu
db778debb8 Fix error logging for validate_server_conf (#472) 2017-07-12 22:44:48 -07:00
James Lu
b8a254167c p10: rename the 'p10_ircd' option to 'ircd', for consistency with ts6 2017-07-12 22:22:05 -07:00
James Lu
3d27e4a347 ts6: add support for ChatIRCd
This depreates the "use_elemental_modes" setting on ts6 networks, and replaces it with an "ircd" option targetting charybdis, elemental-ircd, or chatircd
Closes #339.
2017-07-12 22:21:34 -07:00
James Lu
b081270aa1 ts6: tweak some misplaced mode definitions
Charybdis provides deaf as umode +D and ssl as umode +Z
2017-07-12 22:21:34 -07:00
Mitchell Cooper
3e356180a0 use isinstance() for conf values as well 2017-07-12 17:38:31 -04:00
Mitchell Cooper
7ab0e8f105 use isinstance() instead of type() where appropriate #410 2017-07-12 17:29:34 -04:00
Mitchell Cooper
87fe7693b0 ircs2s_common: use conf.validate() instead of assertion in validate_server_conf() (#485)
Closes #472.
2017-07-12 14:17:41 -07:00
James Lu
cb368439cf inspircd: bring back extended WHOIS replies via a force_whois_extensions option 2017-07-12 08:28:32 -07:00
James Lu
50e7b0ab13 Limit signon time in WHOIS replies to service bot targets
Faking signon time for relay clients, etc. is misleading...
2017-07-12 07:49:19 -07:00
James Lu
556c2efb0a Make showing startup time an option (whois_show_startup_time) 2017-07-12 07:44:18 -07:00
James Lu
3fb563bb43 inspircd: get rid of IDLE->WHOIS hack
This is unnecessary as sending 0 for both the idle time and signon time will tell the IRCd to not show anything.

...But we track our startup time, so we can actually pass that as a value (Anope does this as well)
2017-07-12 07:23:00 -07:00
James Lu
1438f9e566 p10: also acknowledge our own kicks with a PART 2017-07-11 02:36:00 -07:00
James Lu
fbaa12de71 p10: use is_halfop_plus when checking whether we need to override 2017-07-11 02:27:44 -07:00
James Lu
b7466327db protocols: move S2S_BUFSIZE definition into a class variable 2017-07-07 20:14:26 -07:00
James Lu
3a42c8e835 protocols: add _check_oper_status_change abstraction
This condenses a large chunk of the code checking for oper ups, and adds support for the servprotect/admin umodes in an IRCd-independent manner. Closes #451.
2017-07-07 20:04:21 -07:00
James Lu
5955d3f90f p10: expand nick!user@host only for topic setters that are clients 2017-07-07 13:37:16 -07:00
James Lu
c2f12460da unreal, p10: condense topic_burst and topic together
Closes #480.
2017-07-07 13:35:30 -07:00
James Lu
67a36b7ebe inspircd: rename _operUp to _oper_up 2017-07-07 13:27:45 -07:00
James Lu
5d5c861a93 protocols: rename check_nick_collision to _check_nick_collision 2017-07-07 03:18:40 -07:00
James Lu
c5d06b2d41 ngircd: run check_nick_collision in handle_nick, per #375 2017-07-07 03:16:56 -07:00
James Lu
bd79c71b85 unreal: fix TypeError in mode() from accessing set items by index 2017-07-07 03:16:17 -07:00
James Lu
28d2f89311 ngircd: implement KILL 2017-07-07 02:52:57 -07:00
James Lu
67a414fa2a ngircd: set slash-in-hosts, slash-in-nicks, underscore-in-hosts capabilities 2017-07-07 02:46:14 -07:00
James Lu
57c86c6d25 ngircd: implement update_client() 2017-07-07 02:41:20 -07:00
James Lu
fa2c5d928a IRCS2SProtocol: fix extraneous umode based AWAY messages 2017-07-06 22:17:47 -07:00
James Lu
6636a19a2b ngircd: implement handler for METADATA 2017-07-06 22:15:56 -07:00