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

717 Commits

Author SHA1 Message Date
James Lu
113fbf9eb8 clientbot: return existing PUIDs in spawnClient if nick exists
This fixes some silly UID duplication with FNC handling.
2016-08-31 23:22:24 -07:00
James Lu
ae63f72cf9 clientbot: decouple inbound and outbound nick changes 2016-08-31 23:12:45 -07:00
James Lu
9bda4094e4 clientbot: handle pre-auth FNC better
Closes #321.
2016-08-31 23:05:36 -07:00
James Lu
be960bf27b clientbot: handle numerics 463 to 465 as fatal error 2016-08-31 22:46:46 -07:00
James Lu
cf5898fb45 clientbot: only send updateClient() hooks if something changes
Closes #323.
2016-08-31 22:32:12 -07:00
James Lu
663d03ed2c relay/clientbot: begin work on outgoing PMs to clientbot users (#318)
This still needs to implement PMs going the other way around, and should eventually distinguish between PMs and private notices.
2016-08-31 14:08:28 -07:00
James Lu
53de6542f6 clientbot: in nick(), make sure irc.pseudoclient exists 2016-08-27 20:39:35 -07:00
James Lu
42a104534a unreal: ensure type safety from last commit 2016-08-27 19:19:47 -07:00
James Lu
8f8cd95395 unreal: use umode +xt instead of SETHOST in spawnClient
This is to ensure vHosts for all PyLink clients are respected.
2016-08-27 19:14:37 -07:00
James Lu
ae94bec6b8 protocols: add a chandata key to SJOIN hook payloads 2016-08-27 18:56:36 -07:00
James Lu
3c7b201f57 protocols: rename 'oldchan' in MODE payloads to 'chandata' 2016-08-27 17:46:35 -07:00
James Lu
814c714145 clientbot: fix nick() using the wrong arguments
I should learn to proofread...

Also, outgoing NICK changes should not implicitly update the state; we should wait for the IRCd's acknowledgement instead.
2016-08-24 22:54:53 -07:00
James Lu
29bfe108fe clientbot: only send SQUIT payload if nicks are affected 2016-08-21 17:43:10 -07:00
James Lu
8cf771be2f ts6: fix typo 2016-08-20 17:36:56 -07:00
James Lu
e9088792af unreal: support TSCTL alltime
Closes #228.
2016-08-17 21:21:18 -07:00
James Lu
c20dd07a2d inspircd: implement /ALLTIME support (#228) 2016-08-12 19:36:40 -07:00
James Lu
94aee8f05c Implement /TIME support (#228) 2016-08-12 19:19:09 -07:00
James Lu
17127dd131 clientbot: send hook payloads for external updateClient
Closes #300.
2016-08-12 18:47:12 -07:00
James Lu
b4e83e7b1a clientbot: basic prefix mode detection (halfop, admin, owner) 2016-08-11 12:46:05 -07:00
James Lu
226089cc3c clientbot: forward SJOIN on the main client as JOIN (#299) 2016-08-11 11:24:23 -07:00
James Lu
3a0a2c7f1c clientbot: don't update state on join()
Wait for NAMES instead to make sure that the join attempt actually succeeded. #299
2016-08-11 11:23:41 -07:00
James Lu
7a0a013c43 clientbot: suppress mode change hooks for internal clients 2016-08-10 21:07:20 -07:00
James Lu
8ac014709b inspircd: track MODSUPPORT and required modules for updateClient()
m_chgident.so, m_chghost.so, and m_chgname.so are required for ident, host, and real name setting to work, respectively.
2016-08-08 23:40:48 -07:00
James Lu
72f9019300 clientbot: remove self.irc.users print 2016-08-08 23:40:24 -07:00
James Lu
12e1a0edff Move handle_error() to the generic protocol 2016-08-08 18:12:07 -07:00
James Lu
73a70d6952 unreal: declare support for ESVID
This capability declares support for account name arguments in service stamps (+d argument in SVS2MODE).

Realistically this doesn't appear to affect any S2S communication, because services packages only check for ESVID support on their uplink, while SVS2MODE is passed raw from services->IRCd->PyLink.
2016-08-08 17:28:45 -07:00
James Lu
671d6d1893 unreal: request VHP capability so cloaked hosts for Unreal3.2 users are sent 2016-08-08 17:05:28 -07:00
James Lu
7dcabf072b unreal: fix services login tracking for UnrealIRCd 3.2 + Anope 1.8
More specifically, if the +d argument in SVS2MODE is a non-zero integer, ignore it and use the user's nick as account name instead.
2016-08-08 16:35:10 -07:00
James Lu
b36ce36451 protocols: send old IrcServer object (serverdata) in SQUIT hooks 2016-08-04 12:50:04 -07:00
James Lu
1c0900b29d clientbot: introduce virtual SQUIT and SJOIN hooks 2016-08-04 11:48:57 -07:00
James Lu
62099e6078 clientbot: move virtual ENDBURST hook to end of MOTD
Possible fix for #299.
2016-08-04 11:10:51 -07:00
James Lu
0fc0f104bd clientbot: pass realhost and IP options to IrcUser 2016-08-02 23:36:20 -07:00
James Lu
d5c5a34467 Merge branch 'master' into devel
Conflicts:
	protocols/ts6_common.py
2016-08-01 18:07:34 -07:00
James Lu
f60e17907a hybrid, unreal: switch to irc.toLower() for channels 2016-08-01 18:06:38 -07:00
James Lu
9a59c68370 protocols: strip leading prefix modes before checking whether msg target is a channel
(cherry picked from commit 2c7b5669bd)
2016-08-01 17:59:31 -07:00
James Lu
f061a2fc68 ts6: replace str.lower() with irc.toLower() for channel names
(cherry picked from commit 791b124cf7)
2016-08-01 17:59:31 -07:00
James Lu
ac358f4199 ts6: add CHW to required capabilities
This is implicitly used by relay when relaying @#channel messages.
2016-07-31 20:42:34 -07:00
James Lu
2ca3dfe689 ts6_common: rewrite =#channel messages to @#channel (charybdis +z support) 2016-07-31 20:38:25 -07:00
James Lu
2c7b5669bd protocols: strip leading prefix modes before checking whether msg target is a channel 2016-07-31 20:30:51 -07:00
James Lu
77a93b17ac ts6: handle ETB 2016-07-31 20:25:17 -07:00
James Lu
791b124cf7 ts6: replace str.lower() with irc.toLower() for channel names 2016-07-31 20:22:12 -07:00
James Lu
891039dba2 Merge branch 'master' into devel 2016-07-29 14:44:54 -07:00
James Lu
358e03f6ce ts6: don't unconditionally apply modes in outgoing sjoin() 2016-07-29 14:44:25 -07:00
James Lu
8eed60a8f5 nefarious: fix nameerror on start 2016-07-29 01:02:18 -07:00
James Lu
2bc066bacb clientbot: don't send duplicate operups (#289) 2016-07-29 00:56:14 -07:00
James Lu
3ad9362247 clientbot: fix oper tracking, add deoper tracking
Closes #289.
2016-07-29 00:54:47 -07:00
James Lu
f457018f89 unreal: remove mixed_link option; this is now implied
pylink<->unreal4<->unreal3.2 links are stable enough.
2016-07-29 00:37:31 -07:00
James Lu
f4922743fc core: SID and hostname options are now optional (#282)
Hostname defaults to a fallback hardcoded in world.fallback_hostname, while SID defaults to None (protocol modules have to deal with this themselves)
2016-07-28 22:23:59 -07:00
James Lu
87c558537f unreal: refactor to use utils.PUIDGenerator
Closes #238.
2016-07-28 21:59:56 -07:00
James Lu
852bd74c3b core: enumerate our server after calling proto.connect()
This gives protocol modules a chance to manipulate their SID before it's added to the internal server list, replacing hacks previously used by the Nefarious and Clientbot modules.

This is the first step to sid-less servers :)
2016-07-28 21:50:51 -07:00
James Lu
c410de2fad Make server config validation protocol specific
Closes #282.
2016-07-28 21:34:00 -07:00
James Lu
c36c32082f inspircd: support SAKICK 2016-07-28 21:05:59 -07:00
James Lu
a56e464eb6 unreal: handle umode +r on burst as services login, even when no explicit accountname is set
Ref #296.

(cherry picked from commit 5800594d55)
2016-07-28 20:20:35 -07:00
James Lu
4fbb7b1791 unreal: remove obsolete comment about cloaked hosts
(cherry picked from commit e7ccfc9156)
2016-07-28 20:20:35 -07:00
James Lu
94ae457a82 nefarious: fix usermode changes internally applying on the wrong target
A regression from fca23c7d55 overwrote the target UID with a nick before passing it into applyModes(), which raises an "unknown mode target" warning and causes the mode change to be dropped.

(cherry picked from commit af21063834)
2016-07-28 20:20:35 -07:00
James Lu
bc5a508cd7 unreal: rework services login handling
This should now support SVS2MODE without account info, used by Anope versions < 2.0? Also, the protocol module no longer stores umode +r as an actual user mode, as doing so isn't needed.

Closes #296.

(cherry picked from commit 97d09c5015)
2016-07-28 20:20:35 -07:00
James Lu
9233a94379 nefarious: forward CMODE and KICK through the server if the sender isn't opped
This prevents mode bounces, kick failures, and the HACK server notices from showing up.

(cherry picked from commit fca23c7d55)
2016-07-28 20:20:35 -07:00
James Lu
5800594d55 unreal: handle umode +r on burst as services login, even when no explicit accountname is set
Ref #296.
2016-07-27 17:38:37 -07:00
James Lu
e7ccfc9156 unreal: remove obsolete comment about cloaked hosts 2016-07-27 17:38:09 -07:00
James Lu
af21063834 nefarious: fix usermode changes internally applying on the wrong target
A regression from fca23c7d55 overwrote the target UID with a nick before passing it into applyModes(), which raises an "unknown mode target" warning and causes the mode change to be dropped.
2016-07-27 16:55:59 -07:00
James Lu
97d09c5015 unreal: rework services login handling
This should now support SVS2MODE without account info, used by Anope versions < 2.0? Also, the protocol module no longer stores umode +r as an actual user mode, as doing so isn't needed.

Closes #296.
2016-07-27 16:55:59 -07:00
James Lu
4002fb9da5 clientbot: only send AWAY when polling if the message has changed 2016-07-26 23:30:26 -07:00
James Lu
fca23c7d55 nefarious: forward CMODE and KICK through the server if the sender isn't opped
This prevents mode bounces, kick failures, and the HACK server notices from showing up.
2016-07-26 18:31:23 -07:00
James Lu
8ce0ceee37 clientbot: properly track oper 2016-07-25 11:02:25 -07:00
James Lu
db9f362857 clientbot: use colon for realname in USER 2016-07-25 11:02:08 -07:00
James Lu
fcf364f958 clientbot: initialize users with umode +i by default 2016-07-25 00:00:27 -07:00
James Lu
a905f74800 relay/clientbot: rework KICK handling to send the right thing at the right times
Some of the logic was inverted so that the Clientbot would try to kick invalid things like GLolol/ovd, and send clientbot KICK payloads when it's supposed to forward an actual kick.

This also fixes KICKs from servers not being relayed by clientbot.
2016-07-24 11:55:46 -07:00
James Lu
05972e500c clientbot: fix marking of internal/external servers 2016-07-24 11:52:34 -07:00
James Lu
8fc310eb24 clientbot: clear who / kick state on connect 2016-07-24 11:15:33 -07:00
James Lu
51dcfb7d1e clientbot: don't leak private messages via the relay 2016-07-23 21:09:15 -07:00
James Lu
0db9d4e69e relay/clientbot: support relaying KICK, QUIT, NICK, CTCP ACTION, and NOTICE 2016-07-23 18:48:27 -07:00
James Lu
3ec11680ea clientbot: handle nick conflicts on connect (43x) 2016-07-23 12:48:26 -07:00
James Lu
a662f93e15 clientbot: fix part/kick handling to only keep state for internal clients 2016-07-23 12:36:13 -07:00
James Lu
3e91118644 relay/clientbot: implement kick, join, part relaying 2016-07-23 12:25:52 -07:00
James Lu
a402d1057e clientbot: send CLIENTBOT_KICK payloads for external clients 2016-07-23 12:04:32 -07:00
James Lu
88e510b4cf clientbot: begin work on special hooks & move event relaying to a separate plugin 2016-07-23 01:16:26 -07:00
James Lu
7eaf074019 clientbot: poll WHO once every pingfreq 2016-07-23 00:06:11 -07:00
James Lu
91310164be clientbot: more descriptive default hostmasks 2016-07-22 22:52:06 -07:00
James Lu
734db841f1 clientbot: track failed KICKs with /NAMES & a timer
Suggested by @cooper.

This tracking system solves the problem of failed relay kicks causing channel desyncs, because what's seen as a successful KICK when PyLink is linked as a service might not forward
successfully on clientbot network. This can be caused due to the clientbot not being opped, the target being immune or having higher access than the clientbot, etc. When a NAMES reply
(delayed in this case) is received for any channel where an initial /WHO has already been received, a JOIN hook will be sent for any users on the kick queue to rejoin them on the relay.
2016-07-22 22:36:34 -07:00
James Lu
d41d123969 clientbot: send away hook and remove extraneous stub assignment 2016-07-22 00:45:37 -07:00
James Lu
ff807b3d47 clientbot: basic WHO handling, implement away() stub 2016-07-22 00:22:56 -07:00
James Lu
04ed7a8f5d clientbot: add MODE handling 2016-07-21 19:12:05 -07:00
James Lu
3d7e8f8420 clientbot: fix wrong args to _squit 2016-07-21 19:11:57 -07:00
James Lu
2d886367b5 clientbot: handle prefix modes in NAMES 2016-07-21 18:49:01 -07:00
James Lu
deddbde2b0 clientbot: implement updateClient for tracking client ident/host 2016-07-21 18:49:01 -07:00
James Lu
3e8ed35aea clientbot: stub kill() and numeric() 2016-07-21 18:16:15 -07:00
James Lu
95ee94e747 clientbot: implement outgoing INVITE 2016-07-21 18:14:23 -07:00
James Lu
a2043d6762 clientbot: make services clients manipulatable 2016-07-21 18:13:17 -07:00
James Lu
1507a87f31 clientbot: wait for KICK acknowledgement before updating state 2016-07-21 18:04:36 -07:00
James Lu
09ce38a53d clientbot: fix wrong variable 2016-07-21 00:11:15 -07:00
James Lu
dac043a1b6 clientbot: stub updateClient too 2016-07-21 00:04:49 -07:00
James Lu
7a93c1bbb1 clientbot: capability negotiation (cmodes,umodes,prefixmodes,casemapping) 2016-07-20 23:59:22 -07:00
James Lu
eef54cd77d classes: Move ISUPPORT-style PREFIX and capabilities handling to Protocol 2016-07-20 23:59:22 -07:00
James Lu
75d88224f1 clientbot: document some functions 2016-07-20 23:59:22 -07:00
James Lu
d2a3a64293 clientbot: use rfc2812-style USER, kthx 2016-07-20 23:59:22 -07:00
James Lu
f970f760aa clientbot: *untested* autopreform support 2016-07-20 23:55:34 -07:00
James Lu
8fb3310d33 clientbot: properly stub a lot more functions 2016-07-20 23:55:34 -07:00
James Lu
dd0c5c7e63 clientbot: format kick reasons with the sender prefix 2016-07-20 23:55:34 -07:00
James Lu
e7ae6ddbff clientbot: in conditionals, don't break if irc.pseudoclient isn't set yet 2016-07-20 23:55:34 -07:00
James Lu
de618393c0 Fix SQUIT handling from 2f1a338 2016-07-20 23:55:34 -07:00
James Lu
387d47808c clientbot: add nick, kick handling; squit and sjoin stubs 2016-07-20 23:55:34 -07:00
James Lu
154421ffde Move SQUIT abstraction into core 2016-07-20 23:55:34 -07:00
James Lu
8b4b08f589 clientbot: names, join, part, quit handling 2016-07-20 23:55:34 -07:00
James Lu
027dfe46a4 clientbot: handle notice, privmsg
This is literally the world's most useless IRC bot now.
2016-07-20 23:55:34 -07:00
James Lu
b1b13a5c63 clientbot: fix args list 2016-07-20 23:55:34 -07:00
James Lu
8981d71fd0 protocols: rename _getOutgoingNick() -> _expandPUID() 2016-07-20 23:55:34 -07:00
James Lu
e0b254e6ad clientbot: ping/pong support 2016-07-20 23:55:34 -07:00
James Lu
58fa769ba0 clientbot: implement JOIN, uplink enumeration 2016-07-20 23:55:34 -07:00
James Lu
c52d542ed8 Initial Clientbot stub, with very rudimentary user handling (#144) 2016-07-20 23:55:34 -07:00
James Lu
1770058e1b Move ts6_common.parseTS6Args to ts6_common.parsePrefixedArgs 2016-07-20 23:55:34 -07:00
James Lu
47a0a7f8c6 Make plugins/ and protocols/ namespaces 2016-07-20 23:55:26 -07:00
James Lu
80d7be8c7d nefarious: add (untested) SVSNICK handler based on P10 docs
Closes #269.
2016-07-12 21:58:08 -07:00
James Lu
bced9506c3 ts6: add RSFNC to supported caps 2016-07-11 23:29:44 -07:00
James Lu
21d03e7b69 protocols: implement SVSNICK hooks for InspIRCd, Charybdis, UnrealIRCd (#269)
More testing still needs to be done with this on Nefarious, as atheme (what I'm testing against) doesn't use P10 SVSNICK yet.
2016-07-11 23:21:08 -07:00
James Lu
7c1a80708b unreal: demote mode bounce notices to DEBUG 2016-07-11 16:37:01 -07:00
James Lu
64dd7e9387 unreal: fix server name of the uplink not being saved
Closes #268.
2016-07-11 16:20:10 -07:00
James Lu
c04f9d1879 protocols: move handlers for AWAY, VERSION, WHOIS, and QUIT to ircs2s_common 2016-07-11 16:08:46 -07:00
James Lu
d91589c4da protocols: move handle_whois to ts6_common 2016-07-11 16:00:08 -07:00
James Lu
84452bec2e inspircd: always make PyLink handle WHOIS (closes #267)
This removes the use_experimental_whois option, which is always enabled now.

The rationale behind this is that PyLink cannot accurately track signon and idle times for things like relay users, without forwarding WHOIS requests between servers in a way the hooks system is really not optimized to do. However, no IDLE response means that no WHOIS data is ever sent back to the calling user, so this workaround is probably the best solution, aside from faking values.
2016-07-10 22:08:56 -07:00
James Lu
c1cd6f42a0 updateTS: Fix mode tracking again
It looks like we actually do need to track whether we're sending or receiving modes. This time, do so /properly/.
2016-07-10 21:36:18 -07:00
James Lu
fa59e2bded ts6_common: force nick TS to 100 in SAVE 2016-07-10 21:20:47 -07:00
James Lu
a06b478a2e ts6_common: update nick TS on SAVE as well (#267) 2016-07-10 21:14:12 -07:00
James Lu
16b162ffbe protocols: update nick TS on nick change (#267) 2016-07-10 21:10:57 -07:00
James Lu
ade0fa707e nefarious: fix wrong variable in last commit 2016-07-10 21:01:01 -07:00
James Lu
8b04a51daf nefarious: only send EOB_ACK to uplink
Closes #266.
2016-07-10 20:37:21 -07:00
James Lu
1675c43841 ts6: the @cooper fix
Validate that incoming TS is valid, because bad user timestamps like 0 will cause InspIRCd networks to SQUIT if forwarded over Relay.
2016-07-10 20:37:07 -07:00
James Lu
7d321e2e6c inspircd: only send services_login hooks if the user exists
With SASL, services_login can be called before the user is registered. We should ignore that because the actual accountname is still bursted later.
2016-07-08 12:08:13 -07:00
James Lu
e0f050c195 Irc: add getFriendlyName() abstraction
Closes #260.
2016-07-06 22:30:21 -07:00
James Lu
3b80802d1a protocols: rewrite encapsulated commands implicitly
Closes #182.
2016-07-05 13:27:31 -07:00
James Lu
ed6293e54a nefarious: define access_sort() as a static method 2016-07-05 00:42:17 -07:00
James Lu
5ef135d888 nefarious: use handle_kill (with kill path support) from ircs2s_common
Ref #239.
2016-07-05 00:31:24 -07:00
James Lu
bfa69815b4 protocols: split things common between nefarious and ts6_common into a new ircs2s_common module 2016-07-05 00:24:23 -07:00
James Lu
26f4a9c276 nefarious: fix 'changedmodes' type inconsistency causing crashes 2016-07-05 00:13:33 -07:00
James Lu
d549e2ae47 protocols: format kills properly in ts6_common.handle_kill() (#239)
This separates the kill handling for InspIRCd and other TS6 protocols, as InspIRCd pre-formats kills when they are sent.
2016-07-05 00:08:02 -07:00
James Lu
3457da16bd protocols: Move kill() into ts6_common, and make unreal.py use it
Ref #239. protocols/unreal was hardcoding a killpath, lazy me...
2016-07-04 23:43:11 -07:00
James Lu
d0b7d44f1a ts6: implement kill paths in outgoing KILL (#239) 2016-07-04 23:43:11 -07:00
James Lu
6c8731a55a inspircd: refactor opertype handling and opertypes for Services
This gives all protected service clients with +k a special "Network Service" opertype.
2016-07-01 21:03:10 -07:00
James Lu
55e0da96c3 Merge remote-tracking branch 'origin/master' into devel 2016-07-01 20:42:46 -07:00
James Lu
fde7860fc7 ts6: fix wrong args in TB handling
I'm not sure where I got that example from. It's wrong.
2016-07-01 19:45:13 -07:00
James Lu
e8ecc1c775 ts6: 10 modes per line, not 9
I must've made it shorter just to be safe, but that isn't necessary.
2016-06-27 23:40:58 -07:00
James Lu
982e7c43f2 ts6: cut off BMASK at 12 args per line to prevent message cutoff
Ref #253.
2016-06-27 23:35:56 -07:00
James Lu
12f1cce6a9 ts6: 12 users max are allowed in each SJOIN message, not 10 2016-06-27 23:13:39 -07:00
James Lu
f458a40e1c inspircd: new use_experimental_whois option, which forces PyLink to handle WHOIS requests locally 2016-06-27 22:28:37 -07:00
James Lu
57afa806e3 inspircd: implement raw numeric sending 2016-06-27 22:28:00 -07:00
James Lu
b1e138d9c5 nefarious: fix wrong variable in "/join 0" handling causing crashes
(cherry picked from commit 5cb550afd9)
2016-06-26 11:38:09 -07:00
James Lu
fbeb3a3747 protocols: fix ts actually defaulting to None in sjoin() 2016-06-25 13:56:24 -07:00
James Lu
d2956c3d00 protocols: return uplink field in SQUIT handlers 2016-06-25 13:34:43 -07:00
James Lu
5cb550afd9 nefarious: fix wrong variable in "/join 0" handling causing crashes 2016-06-25 11:33:56 -07:00
James Lu
167963ddc4 updateTS: fix handling for outbound modes
Outgoing and incoming modes should be handled the same way - we're only dealing with a "received TS" which could originate from PyLink (sjoin() in protocols) OR the uplink.
2016-06-24 13:24:44 -07:00
James Lu
77e13bce03 inspircd: fix logic for tracking existing bans in sjoin() 2016-06-23 22:36:22 -07:00