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

252 Commits

Author SHA1 Message Date
James Lu
278339b5e2 unreal: actually enable the SJOIN cap, handle ban bursts properly 2016-12-31 22:15:42 -08:00
James Lu
5f6337a734 Merge branch 'master' into devel
Conflicts:
	plugins/networks.py
2016-12-18 00:15:24 -08:00
James Lu
194a62fcea protocols: implement basic nick collision detection in UID handlers
Closes #285. Closes #375.
2016-12-18 00:13:42 -08:00
James Lu
c57fabc9ef core, protocols: add server argument to IrcUser (#355) 2016-11-09 18:40:16 -08:00
James Lu
4dd0709f66 protocols, core: remove unused imports 2016-10-01 12:43:12 -07:00
James Lu
c5c77eeb97 protocols: chandata->channeldata for MODE and JOIN hooks 2016-09-02 17:52:19 -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
e9088792af unreal: support TSCTL alltime
Closes #228.
2016-08-17 21:21:18 -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
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
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
87c558537f unreal: refactor to use utils.PUIDGenerator
Closes #238.
2016-07-28 21:59:56 -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
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
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
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
8981d71fd0 protocols: rename _getOutgoingNick() -> _expandPUID() 2016-07-20 23:55:34 -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
d91589c4da protocols: move handle_whois to ts6_common 2016-07-11 16:00:08 -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
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
fbeb3a3747 protocols: fix ts actually defaulting to None in sjoin() 2016-06-25 13:56:24 -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
2936e94f50 unreal: warn about mode bounces instead of fighting with the uplink 2016-06-22 22:37:53 -07:00
James Lu
f2b139c828 core: make inbound SJOINs also respect the updateTS() rules 2016-06-22 22:28:15 -07:00
James Lu
6b8e80cd5b core/protocols: add modes option in sjoin(), TS6 BMASK, and mode TS rules in updateTS()
Closes #249.
Closes #250.
2016-06-22 21:34:16 -07:00
James Lu
101bd9664e unreal: fix typo in comment 2016-06-21 17:03:23 -07:00
James Lu
481d70eff8 New import paths for properly installed pylinkirc 2016-06-20 18:18:54 -07:00
James Lu
3e19e9c3f1 unreal: add missing inviteonly (+i) definition 2016-06-19 21:18:35 -07:00
James Lu
ae87def11f Purge c_ and u_ prefixes from named modes
Closes #217.
2016-05-15 11:05:02 -07:00
James Lu
3bb1208e74 core: move toLower to Irc (#199) 2016-04-30 16:57:38 -07:00
James Lu
78f8a2fc8d core: move isManipulatableClient, getHostmask to Irc 2016-04-30 16:44:37 -07:00
James Lu
064cb9b6aa core: move reverseModes, joinModes into Irc 2016-04-30 16:33:46 -07:00
James Lu
bd0874a484 Merge branch 'wip/split-utils' into devel 2016-04-29 23:32:52 -07:00
James Lu
b78b911323 unreal: fix JOIN handling & normalize channel case
Reported by Rascle on IRC.
2016-04-28 19:17:20 -07:00
James Lu
a8fc9428cf protocols: migrate to irc.parseModes/applyModes (#199) 2016-04-24 21:44:31 -07:00
James Lu
40a86de040 protocols: reword spawnClient description text 2016-04-24 21:17:56 -07:00
James Lu
f8c2ee3ed3 protocols: use KeyedDefaultdict to enumerate UID generators 2016-04-24 21:16:41 -07:00
James Lu
2c60aa6395 Separate UID/SID generators into various protocol modules (#199) 2016-04-24 21:08:07 -07:00
James Lu
0ccdf4cfce unreal: require UMODE2 cap too
I realize we don't handle MODE being used for users at all. UMODE2 is always used when enabled, which is what we're expecting right now.
2016-04-09 11:43:26 -07:00
James Lu
5dee6ab651 unreal: simplify capability checks & require NICKIP cap 2016-04-09 11:34:09 -07:00
James Lu
29030073b9 unreal: request NICKIP capability, track Unreal 3.2 user IPs
Closes #196.
2016-04-09 10:17:25 -07:00
James Lu
62c8cd2405 protocols: s/_getNick/_getUid/g
The old function name _getNick was a bit misleading, as the function converted nicks to UIDs, not the other way around..
2016-04-08 22:21:37 -07:00
James Lu
1e3aba2cce protocols: simplify super() syntax 2016-04-05 18:37:09 -07:00
James Lu
f620b5b4e8 protocols: initialize sidgen/uidgen in ts6_common 2016-04-05 18:34:54 -07:00
James Lu
55afa1bff6 unreal: log instances of PUID manging to debug 2016-04-03 13:01:08 -07:00
James Lu
75984c3c4c ts6_common: add abstraction to convert UIDs->outgoing nicks
This is a more complete fix for #193.
2016-04-03 12:57:47 -07:00
James Lu
9f20f8f767 unreal: update SJOIN matching regex
We should only treat symbols as a possible prefix, not letters. Things like +nick might be sent in a SJOIN instead of +001AAAAAA, for legacy servers.
2016-04-03 12:57:47 -07:00
James Lu
e687bb0a78 unreal: remove outfilter hack, this doesn't handle text including PUIDs properly
Reverts part of 44dc856ffa.
2016-04-03 12:38:38 -07:00
James Lu
02ec50826b unreal: fix super() syntax in SQUIT handling 2016-04-02 12:12:38 -07:00
James Lu
6acfbb4125 unreal: case-desensitize legacy server names when handling user introductions from them 2016-04-02 11:51:29 -07:00
James Lu
956167538a unreal: add warnings & more descriptive errors regarding mixed_link 2016-04-02 10:56:41 -07:00
James Lu
f3ceefe87f unreal: initialize legacy users on the right server 2016-04-02 10:56:13 -07:00
James Lu
c4273e68a4 unreal: fix for Python 3.4 support
The general syntax for unpacking lists with *list was only introduced in Python 3.5: https://www.python.org/dev/peps/pep-0448/
2016-04-02 09:32:03 -07:00
James Lu
4f08894227 unreal: typofix 2016-04-01 23:35:48 -07:00
James Lu
10be962318 unreal: actually return the hook data for NICK & KILL 2016-04-01 23:27:31 -07:00
James Lu
44dc856ffa unreal: use an awful outFilter hack to convert PUIDs->nicks when sending outgoing commands 2016-04-01 23:14:04 -07:00
James Lu
74ee1ded4d unreal: Start work on some really hacky Unreal 3.2 compat code (#193)
What works:
- Tracking user JOINs, QUITs, PARTs

What doesn't work:
- Sending messages from PyLink clients to 3.2 users. They have fake UIDs (nick@counter) which don't go anywhere, meaning messages are silently dropped.
2016-04-01 23:02:12 -07:00
James Lu
fd32bbf45f unreal: fix typo in last commit 2016-04-01 19:12:58 -07:00
James Lu
efcc30c983 unreal: don't confuse legacy SERVER introductions from our uplink with protocol negotiation
Reported by Rascle on IRC.
2016-04-01 19:08:25 -07:00
James Lu
70b9bde2c4 unreal: fix a little typo 2016-03-26 13:26:57 -07:00
James Lu
ad517f80da unreal: bump protocol version to 4000 2016-03-26 13:19:06 -07:00
James Lu
19ac5b59a5 protocols: drop underscores from pre-defined opertypes 2016-03-26 13:15:22 -07:00
James Lu
44083ccd5e core: Store opertype info in all IrcUser objects
This allows plugins to define custom opertypes for their clients, and still have them show in WHOIS queries.
2016-03-26 12:55:23 -07:00
James Lu
bdbc1020f2 Merge branch 'master' into devel 2016-03-26 12:50:35 -07:00
James Lu
9cd1635f68 unreal: fix wrong variable name in handle_umode2 2016-03-26 12:50:23 -07:00
James Lu
e183078645 protocols: Remove "secret" testing channel name 2016-03-20 17:34:13 -07:00
James Lu
decdf141fd unreal: don't use updateClient to update hostname of clients internally 2016-02-20 18:19:15 -08:00
James Lu
2ebdb4bad6 unreal: support services account tracking (#25), fix handle_SVSMODE applying modes on the wrong target 2016-02-20 18:16:21 -08:00
James Lu
3c3ae104ba unreal: remove bad check for users connecting via IPv4
This fixes a crash when... anyone using IPv4 connects.
2016-01-23 13:52:37 -08:00
James Lu
a220659eaf Move unreal's handle_events block to ts6_common
Precursor to part 2 of #156.
2016-01-16 17:48:22 -08:00
James Lu
812a866a4e protocols: rename pingServer -> ping 2016-01-16 17:11:23 -08:00
James Lu
3d0bf18001 protocols: rename topicClient -> topic; topicServer -> topicBurst
This is one of the few commands that I won't consolidate at this time, because there is actually a difference in how most IRCds handle topic bursts and normal topic changes
2016-01-16 17:09:52 -08:00
James Lu
5ccf204c75 protocols: consolidate modeClient and modeServer into mode() 2016-01-16 17:08:17 -08:00
James Lu
eef97ac035 protocols: consolidate killServer / killClient into kill() 2016-01-16 17:03:22 -08:00
James Lu
ee65ac60e1 protocols: rename sjoinServer(...) -> sjoin(...) 2016-01-16 16:53:46 -08:00
James Lu
108be5e25e protocols: rename knockClient -> knock 2016-01-16 16:41:17 -08:00
James Lu
b4e5c57a35 protocols: rename inviteClient(...) -> invite(...) 2016-01-16 16:38:27 -08:00
James Lu
acdd7dbb78 protocols: rename joinClient(...) -> join(...) 2016-01-16 16:36:45 -08:00
James Lu
ff6841c551 protocols: record the right sender in TOPIC handlers (first part of #127) 2016-01-09 20:50:55 -08:00
James Lu
8db8f6b6c4 note to self: never use case-insensitive find/replace again 2016-01-09 18:34:41 -08:00
James Lu
48203ff321 protocols: reword error text 2016-01-09 17:44:18 -08:00
James Lu
9a43a620f9 unreal: implicitly set +xt when SETHOST or CHGHOST is received (#136) 2016-01-03 11:28:35 -08:00
James Lu
adcb61da67 unreal: update users' hosts properly on setting +x/-x
Closes #136.
2016-01-03 11:28:26 -08:00
James Lu
eac934c237 classes: sort code, move nickToUid, clientToServer, isInternalClient, isInternalServer into the Irc class
The following BREAKING changes are made:
utils.nickToUid(irc, nick) -> irc.nickToUid(nick)
utils.isInternalClient(irc, uid) -> irc.isInternalClient(uid)
utils.isInternalServer(irc, uid) -> irc.isInternalServer(uid)
utils.clientToServer(irc, uid) -> utils.getServer(uid)
2015-12-31 17:28:47 -08:00
James Lu
741fed9acd protocols: allow changing remote users' hosts in updateClient
Closes #142.
2015-12-30 15:54:09 -08:00
James Lu
bf7522697a Rename PYLINK_CLIENT_OPERED hook -> CLIENT_OPERED
To be consistent, any PYLINK_* hooks should internal hooks sent out by PyLink itself. CLIENT_OPERED, on the other hand, requires protocol modules to send it and thus, shouldn't be labeled as a PYLINK_* hook.
2015-12-26 15:41:22 -08:00
James Lu
11adee9d78 Yet another documentation refresh (#113) 2015-12-26 14:45:28 -08:00
James Lu
3f45450969 unreal: move setting irc.connected to AFTER protocol negotiation, and add missing EOS (ENDBURST) handler
The lack of the latter caused relay to *fail* to spawn users whenever an Unreal server reconnects, which should be fixed now.
2015-12-24 18:13:53 -08:00
James Lu
349cff36e1 protocols: in TOPIC hooks, send the topic as keyword "text" instead of keyword "topic"
This is just to be more consistent, as other hooks usually use "text" for text fields.
2015-12-18 22:05:10 -08:00
James Lu
6d597e4482 unreal: call PYLINK_CLIENT_OPERED hooks where we're supposed to 2015-12-17 21:37:01 -08:00
James Lu
f79524e9e1 unreal: remove duplicate import 2015-12-06 17:44:59 -08:00
James Lu
62501ce8f2 unreal: actually, storing the cloaked host instead of the real host is a better idea
This prevents IP leaks, at least until #136 is fixed. Reverts part of b965f2c.
2015-11-28 20:57:33 -08:00
James Lu
f8cc297522 unreal: remove "possible desync" warning in _getNick 2015-11-26 22:52:29 -08:00
James Lu
994eaef12c unreal: forcibly SETHOST to the desired vHost in spawnClient
This prevents real host / IP address leaks, since the "virt host" specified in UID doesn't seem to be respected by the IRCd (real host is shown instead). Workaround for #136.
2015-11-26 22:34:15 -08:00
James Lu
0c068c6543 unreal: fix #137
a.k.a. fix the mess I made encoding IPs by not knowing about socket.inet_pton / socket.inet_ntop.
2015-11-26 22:15:52 -08:00
James Lu
b965f2c4b0 unreal: store the displayed host, not the Unreal-cloaking (+x) host in users
I was misinterpreting the UID command syntax. See #136 for what still has to be done.
2015-11-22 13:07:25 -08:00
James Lu
5c0517ba40 unreal/ts6/relay: add some more user mode support
Cloaking is still a bit iffy on UnrealIRCd networks - Unreal insists on applying its own cloaking for +x users, but vHosts for non +x remote users don't apply at all (their real host is shown instead)
2015-11-21 23:57:24 -08:00
James Lu
e86d21e67d unreal: map SETHOST/IDENT/NAME to the right hooks 2015-11-21 23:28:39 -08:00
James Lu
06539fc813 unreal: add missing SJOIN->JOIN hook map, and set irc.connected (relay will otherwise break) 2015-11-15 21:42:58 -08:00
James Lu
0f269da9b8 unreal: add outgoing KNOCK
In Unreal, KNOCKs are simply specially formatted notices sent from the orginating user's server. No special inbound hook is used to handle this as a result.
2015-11-15 21:09:40 -08:00
James Lu
2ddb72f9ec unreal: add incoming/outgoing INVITE support 2015-11-15 21:00:51 -08:00
James Lu
89e515f513 unreal: don't set TS to 0 when it's sent in MODE (samode overrides the timestamp as this to ensure it always works) 2015-11-15 09:52:01 -08:00
James Lu
7e8e8f33f7 unreal: add updateClient 2015-11-15 09:45:46 -08:00
James Lu
a5a2481205 unreal: handle sethost, chghost, and all that 2015-11-15 09:30:29 -08:00
James Lu
ac48c49591 Move squitServer/spawnServer to ts6_common, add topicServer for Unreal 2015-11-15 09:12:21 -08:00
James Lu
5664218254 unreal: add WHOIS handling 2015-11-11 19:40:26 -08:00
James Lu
8c60782753 unreal: add modeClient/modeServer 2015-11-11 19:24:57 -08:00
James Lu
76472560ab unreal: add killServer/killClient 2015-11-11 19:09:37 -08:00
James Lu
fcd1bf5c37 unreal: fix typo in one updateTS call 2015-11-11 19:09:30 -08:00
James Lu
6f9feb46b1 unreal: fix last commit (actually map the hook & set modes on RIGHT target) 2015-11-11 18:55:05 -08:00
James Lu
6601071d35 unreal: add svsmode/svs2mode handler 2015-11-08 15:27:09 -08:00
James Lu
119aa8939b unreal: use Protocol.updateTS() for TS checks 2015-11-08 15:27:09 -08:00
James Lu
6f36fb7126 unreal: alias SVSKILL to KILL 2015-11-01 21:50:46 -08:00
James Lu
4a4c43d3c4 unreal: handle timestamps in MODE (channel bursts), ignoring when TS is 0 2015-11-01 21:41:41 -08:00
James Lu
dbe24973d5 unreal: add joinClient + sjoinServer, support +qaohv properly 2015-10-12 19:38:38 -07:00
James Lu
f0ff14fda9 unreal: fix spawnClient manipulatable setting 2015-10-12 19:34:52 -07:00
James Lu
90fd64b125 unreal: store IPs properly, now that I understand how... 2015-10-12 18:45:25 -07:00
James Lu
399f89900b unreal: TOPIC inbound handler (#104) 2015-10-12 18:25:30 -07:00
James Lu
00a6008078 unreal: we can send NETINFO instantly now, since network full name is a config option 2015-10-12 18:20:16 -07:00
James Lu
b5677806e7 unreal: bump protocol version to 3999 (Unreal 4.0.0-rc1) 2015-10-12 18:17:58 -07:00
James Lu
1eeeba1e86 unreal: support legacy server introduction (#119) 2015-10-12 18:15:39 -07:00
James Lu
2fc0e086ae unreal: rename _convertNick => _getNick 2015-10-12 17:58:36 -07:00
James Lu
4f4ad7b54d unreal: switch to _getSid for server name reverse lookup 2015-10-12 17:50:44 -07:00
James Lu
6e30a62a4a unreal: SQUIT and SID handlers (#114) 2015-10-09 22:38:28 -07:00
James Lu
d5a2d3b0e8 unreal: fix incorrect comment 2015-10-09 21:39:09 -07:00
James Lu
a3ee7f2c8a unreal: handle UMODE2 (self user mode changes)
For #114. TODO: find out if it's possible to set modes on other users, and handle that if applicable
2015-10-09 21:37:44 -07:00
James Lu
9927627630 unreal: add handle_mode (channel modes) and support for unreal +f (#104) 2015-10-08 21:06:57 -07:00
James Lu
c50866c3a9 unreal: Fix handle_sjoin (#104) 2015-10-08 20:48:10 -07:00
James Lu
963b9e978e unreal: Add handle_sjoin (#104) 2015-10-08 20:46:30 -07:00
James Lu
009cac2263 unreal: fix joinClient not adding users to state (#104) 2015-10-08 20:44:12 -07:00
James Lu
665481276d unreal: update spawnClient to latest spec, improve handle_events and documentation to be more correct 2015-10-08 20:28:21 -07:00
James Lu
886994475d Merge branch 'master' into wip/unrealircd
Conflicts:
	classes.py
2015-09-23 18:59:17 -07:00
James Lu
ca3372b0af protocols/unreal: class()-ify everything 2015-09-10 18:41:01 -07:00
James Lu
871e6a5c47 unreal: JOIN handlers 2015-09-05 12:29:20 -07:00
James Lu
76246dea70 unreal: add NOTICE and PRIVMSG (inbound/outbound) 2015-09-05 12:02:45 -07:00
James Lu
b63d7619da unreal: validate uplink protocol version (needs >=2351) 2015-09-05 11:52:46 -07:00
James Lu
cae4c60b56 unreal: stricter protocol negotiation (check needed capabilities) 2015-09-05 11:45:28 -07:00
James Lu
bd30bc862e unreal: Implement spawnClient and (most of) inbound UID handling 2015-09-04 11:51:00 -07:00
James Lu
83725f90ff unreal: coerse sender names to UIDs if they're not given
Unreal's protocol isn't quite consistent with UIDs yet... Some commands (PART, QUIT, NICK) use them, while others (KILL, MODE) don't.
2015-09-04 11:51:00 -07:00
James Lu
6d00309f9f unreal: update imports, add (shared) handlers for QUIT, PART, NICK, and KILL 2015-09-04 11:51:00 -07:00