3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 17:29:21 +01:00
Commit Graph

1005 Commits

Author SHA1 Message Date
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
James Lu
f29c95152b ngircd: remove has-ts from protocol capabilities 2017-07-06 21:49:51 -07:00
James Lu
b0eb1656a5 ngircd: add a stub for KNOCK 2017-07-06 21:47:03 -07:00
James Lu
6d3d2b239d IRCS2SProtocol: ignore attempts to ping the uplink before the link is ready 2017-07-06 21:45:51 -07:00
James Lu
d149576b4e protocols: move invite() into IRCS2SProtocol 2017-07-06 21:43:53 -07:00
James Lu
085b4cacbe protocols: handle usermode-based away (i.e. ngircd +a) 2017-07-06 20:19:52 -07:00
James Lu
b2b50371ab ngircd: fix setting umodes 2017-07-06 20:19:34 -07:00
James Lu
73464e516f ngircd: fill in mode definitions
Source: https://github.com/ngircd/ngircd/blob/master/doc/Modes.txt
2017-07-06 20:12:29 -07:00
James Lu
3d0ccadb76 ngircd: sort handler functions alphabetically 2017-07-06 18:38:25 -07:00
James Lu
28313fd478 ngircd: send burst modes after NJOIN, if there are any 2017-07-06 18:29:34 -07:00
James Lu
961e8ae991 ngircd: add outgoing MODE command 2017-07-06 18:22:56 -07:00
James Lu
4cd1ed5a7b ngircd: add an outgoing sjoin() function using NJOIN 2017-07-06 18:08:46 -07:00
James Lu
45dad63d5b Move handle_mode into IRCS2SProtocol
TODO: clean up protocols/unreal to use more of this code as well
2017-07-06 17:10:03 -07:00
James Lu
694b5018fc Move numeric() into IRCS2SProtocol 2017-07-05 02:36:34 -07:00
James Lu
56c8b90362 IRCS2SProtocol: handle both killpath-based and preformatted kill reasons
Also drop the override in protocols/inspircd, as it is no longer needed.
2017-07-05 02:26:40 -07:00
James Lu
1e5985b608 Merge remote-tracking branch 'origin/beta' into wip/ngircd
Conflicts:
	protocols/ircs2s_common.py
	protocols/ts6.py
2017-07-05 02:26:40 -07:00
James Lu
58558c89ae ngircd: ignore KILLs not meant for us
ngIRCd sends QUIT after a successful KILL, so trying to remove the target twice is erroneous and will cause a crash.

TODO: what happens if an external KILL is never responded to for whatever reason?
2017-07-05 02:17:15 -07:00
James Lu
1acd654e6e ts6: fix 'ts' value type in handle_invite 2017-07-05 02:10:24 -07:00
James Lu
69f3ae52ec ts6: fix wrong argument count when parsing INVITE ts
(cherry picked from commit 7cfc63d6ed)
2017-07-05 02:09:55 -07:00
James Lu
d2d176b6f9 IRCS2SProtocol: fix UnboundLocalError in "message coming from wrong way" warning
This fixes a regression from 69cf21c04e.
2017-07-05 02:08:41 -07:00
James Lu
30b9f47023 unreal: remove handle_kill override; unneeded as of aa4e9335aa 2017-07-05 01:26:45 -07:00
James Lu
c2e65ff9c3 IRCCommonProtocol: alias topic_burst to topic by default (#480) 2017-07-05 00:56:34 -07:00
James Lu
db06ff4338 Move handle_topic to IRCS2SProtocol 2017-07-05 00:48:58 -07:00
James Lu
aa4e9335aa IRCS2SProtocol: expand nicks to UIDs in handle_kill
This allows this handler to work natively on ngIRCd.
2017-07-05 00:36:10 -07:00
James Lu
3729b23e43 Move KICK handlers to IRCS2SProtocol 2017-07-05 00:34:48 -07:00
James Lu
449b547a23 ngircd: properly track server tokens so that users spawn on the right servers
This brings in utils.PUIDGenerator once again for pseudo-SIDs; the counter numbers in these are used directly as server tokens
2017-07-05 00:18:13 -07:00
James Lu
163f0099e7 IRCCommonProtocol: also expand PSIDs in _expandPUID 2017-07-04 23:56:12 -07:00
James Lu
5d4f2149e6 Move squit() to ircs2s_common 2017-07-04 23:41:00 -07:00
James Lu
b780070ee6 ngircd: implement nick changing 2017-07-04 23:26:05 -07:00
James Lu
42a25300c4 ngircd: don't leave user TS none in spawn_client 2017-07-04 23:25:49 -07:00
James Lu
759210a1e4 ngircd: add inbound & outbound JOIN, SERVER 2017-07-04 23:10:12 -07:00
James Lu
84a6cec732 p10: fix endburst_delay note 2017-07-04 23:09:48 -07:00
James Lu
37f0dcb456 ngircd: fix SQUIT user tracking 2017-07-04 23:09:13 -07:00
James Lu
970b38719d core: rename ping() to _ping_uplink(), and drop the unused source/target arguments 2017-07-04 22:09:50 -07:00
James Lu
43af9d1bac protocols: move ping() into IRCCommonProtocol 2017-07-04 22:00:22 -07:00
James Lu
276b0b251d protocols: move handle_pong to IRCCommonProtocol 2017-07-04 21:55:09 -07:00
James Lu
2e5fc2467f ngircd: handle CHANINFO (channel mode/topic bursts) and NJOIN (userlist bursts) 2017-07-03 14:24:57 -07:00
James Lu
7b2f93fd4c ngircd: send an UID hook in user introductions 2017-07-03 14:24:45 -07:00
James Lu
b6b1cbeb2d ngircd: send our own server negotiation info to complete the connection
Aside from the 376, none of this is /required/, but it's best to be consistent...
2017-07-03 13:35:43 -07:00
James Lu
4cdae540b5 IRCCommonProtocol: fix type of maxnicklen 2017-07-03 13:07:38 -07:00
James Lu
66af57e74f IRCCommonProtocol: handle EXCEPTS, INVEX, NICKLEN, DEAF, CALLERID in 005 2017-07-03 13:05:47 -07:00
James Lu
06d69aadf7 clientbot: fix self.connected.set() order 2017-07-03 13:04:43 -07:00
James Lu
a5e7d76341 IRCCommonProtocol: only update the same tokens once per connection 2017-07-03 12:49:38 -07:00
James Lu
ec308acfcb protocols: move 005 handling code to IRCCommonProtocol
Also enable extended server negotiation for ngIRCd, which really just passes 005 between servers (nifty!)
2017-07-03 12:45:39 -07:00
James Lu
e9d7ac39ea ngircd: remove duplicate function 2017-07-03 12:21:44 -07:00
James Lu
091c763a0f Initial ngIRCd protocol stub 2017-07-03 00:24:26 -07:00
James Lu
8bf65f3820 ircs2s_common: implicitly expand PUIDs in _send_with_prefix 2017-07-03 00:13:17 -07:00
James Lu
78034096a8 protocols: merge _expandPUID into ircs2s_common 2017-07-03 00:11:49 -07:00
James Lu
8ddcc4d9a6 Move part, quit, message, notice, topic, _send_with_prefix, _expandPUID to ircs2s_common 2017-07-03 00:05:58 -07:00
James Lu
f163d7ddde protocols: remove extraneous "Error: " from exception messages 2017-07-02 22:52:46 -07:00
James Lu
c9272c25ce IRCS2SProtocol: skip implicit message sender fetching if the first arg starts with a : 2017-07-02 22:44:57 -07:00
James Lu
640e903dd6 Move _get_SID/_get_UID to IRCCommonProtocol 2017-07-02 22:36:47 -07:00
James Lu
e9a6328566 protocols: remove unnecessary handle_squit overrides 2017-07-02 22:20:52 -07:00
James Lu
d4260734dc clientbot: make sure incoming server messages don't clash with a PSID/PUID 2017-07-02 22:13:57 -07:00
James Lu
1e39fb78db clientbot: rename _validateNick -> _check_puid_collision 2017-07-02 22:11:40 -07:00
James Lu
ce2852bdc0 clientbot: get rid of _get_SID in message parsing
It isn't needed because any external server messages are sent raw.
2017-07-02 22:09:22 -07:00
James Lu
51d8d3b3b8 clientbot: store external server names raw instead of using server name mangling 2017-07-02 21:59:40 -07:00
James Lu
ee5a884328 clientbot: fix imports for PyLink 2.0 2017-07-02 21:59:29 -07:00
James Lu
54d7fe6dc5 protocols: convert IrcServer usage to Server 2017-06-30 21:45:10 -07:00
James Lu
a204d2b2db core: convert IrcUser calls to User 2017-06-30 21:44:31 -07:00
James Lu
b81a03fda9 protocols: Channel.removeuser -> Channel.remove_user 2017-06-30 21:40:50 -07:00
James Lu
7d68c03101 various: convert sortPrefixes/getPrefixModes calls to snake case 2017-06-30 21:40:05 -07:00
James Lu
927fa9aac9 protocols: updateClient -> update_client 2017-06-30 21:29:38 -07:00
James Lu
f38b9c9a2c protocols: topicBurst -> topic_burst 2017-06-30 21:29:11 -07:00
James Lu
d0846170c4 protocols: spawnServer -> spawn_server 2017-06-30 21:27:15 -07:00
James Lu
f60dc8fa37 protocols: spawnClient -> spawn_client 2017-06-30 21:25:58 -07:00
James Lu
0c7fb861f1 classes, relay, ircs2s_c: tweak/remove various debug statements 2017-06-29 23:19:21 -07:00
James Lu
a4e321522b protocols: migrate away from camel case 2017-06-29 22:56:14 -07:00
James Lu
3f240bd9e8 p10: mark check_cloak_change as private 2017-06-29 22:21:08 -07:00
James Lu
930a7e19f1 unreal: checkCloakChange -> _check_cloak_change 2017-06-29 22:20:30 -07:00
James Lu
741528b0b3 Merge handle_invite into IRCS2SProtocol (#454) 2017-06-29 22:17:46 -07:00
James Lu
2034bfcc83 IRCS2SProtocol: sort handle_* methods alphabetically 2017-06-29 22:17:46 -07:00
James Lu
7cfc63d6ed ts6: fix wrong argument count when parsing INVITE ts 2017-06-29 22:17:46 -07:00
James Lu
d01e797219 Merge handle_part into IRCS2SProtocol (#454) 2017-06-29 22:17:43 -07:00
James Lu
58a4215690 ratbox: fix support for merged Irc/proto 2017-06-29 21:55:52 -07:00
James Lu
67347935b5 ircs2s_common: add missing ProtocolError import 2017-06-29 21:55:33 -07:00
James Lu
c9c01def8c ts6_common: continue using self.irc in TS6SIDGenerator 2017-06-29 21:51:02 -07:00
James Lu
77357b765e clientbot: rename various private functions
* capEnd -> _do_cap_end
* requestNewCaps -> _request_ircv3_caps
* saslAuth -> _try_sasl_auth
* sendAuthChunk -> _send_auth_chunk
* parseMessageTags -> parse_message_tags
2017-06-27 22:28:31 -07:00
James Lu
310f3f23b8 protocols: rename various parse* functions (no migration stub)
Renamed to camel case:
- parseArgs -> parse_args
- parsePrefixedArgs -> parse_prefixed_args

Renamed to show that we're specifically parsing ISUPPORT data:
- parseCapabilities -> parse_isupport
- parsePrefixes -> parse_isupport_prefixes
2017-06-27 17:16:46 -07:00
James Lu
56275c5a3b NetworkCore: rename removeClient -> _remove_client (no migration stub) 2017-06-27 16:21:30 -07:00
James Lu
7814914a05 classes, protocols: convert self.irc usage to self 2017-06-25 02:09:52 -07:00