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

111 Commits

Author SHA1 Message Date
James Lu
c82a0a771c protocols: return an "oldchan" IrcChannel object with the previous state of a channel when processing channel mode changes
This allows plugins to check for op statuses, etc. before the mode change is processed.
2015-09-13 13:47:18 -07:00
James Lu
17282aa049 protocols: fix typo and ts6._sendModes when input is a set() 2015-09-12 23:35:20 -07:00
James Lu
3a8d3d146c protocols: make "uidgen" a protocol instance attribute 2015-09-12 16:02:51 -07:00
James Lu
0cbdefcab1 ts6/inspircd: fix TS6SIDGenerator not actually incrementing...
It was being replaced on every call... It was only supposed to do that if sidgen hadn't been set yet!
2015-09-12 12:08:02 -07:00
James Lu
df42a81191 classes/protocols: store server descriptions internally
Closes #106.
2015-09-12 12:07:59 -07:00
James Lu
29065fdd04 protocols/: remove unused imports & various documentation improvements 2015-09-08 19:51:14 -07:00
James Lu
57da0aa3b3 Classify all our protocol modules - why didn't I do this earlier 2015-09-05 18:00:57 -07:00
James Lu
9f2d8a1b01 Document the sources of protocols/inspircd & ts6_common 2015-09-05 14:25:11 -07:00
James Lu
72cfe04904 protocols: respect serverdesc config options in spawnServer 2015-09-04 18:59:57 -07:00
James Lu
759f6c4492 protocols/: add outgoing squitServer() 2015-09-04 18:55:39 -07:00
James Lu
47a63cb8d6 Merge branch 'master' into devel 2015-09-04 18:48:08 -07:00
James Lu
8f70582d1b ts6: fixes to spawnServer
1) Use SID, not SERVER - This allows us to actually spawn clients on these servers...
2) Fix check for existing server names (drop the .keys() loop, it raises TypeError and isn't needed)
2015-09-04 18:47:53 -07:00
James Lu
167f5cd0cf Move shared stuff into a ts6_common library
Closes #78.
2015-09-04 11:24:40 -07:00
James Lu
1be4034681 Make TS6 command parsing a shared library (#78) 2015-09-03 12:59:50 -07:00
James Lu
ce83bea09a ts6: less garbled error message for UID handler 2015-09-02 23:51:16 -07:00
James Lu
0b590d6ab3 relay/protocols: use utils.toLower() for channel names, respecting IRCd casemappings
Closes #102.
2015-09-01 22:01:22 -07:00
James Lu
5480ae14c4 classes: Remove "opertype" IrcUser() argument
This is useless and should've never been here, oops.
2015-08-31 14:11:12 -07:00
James Lu
f9b4457ced Decorate relay clients, etc. with custom OPERTYPEs
New PyLink internal hook: PYLINK_CLIENT_OPERED, called (supposedly) when a client opers up.
2015-08-31 13:31:20 -07:00
James Lu
4a964b1595 Merge branch 'master' into devel 2015-08-31 10:58:47 -07:00
James Lu
37eecd7d69 pr/inspircd: use OPERTYPE to oper up clients correctly, and handle the metadata accordingly 2015-08-31 10:31:50 -07:00
James Lu
549a1d1ba4 classes: IrcServer.users is now a set() 2015-08-29 12:35:06 -07:00
James Lu
80bebe3827 protocols: also validate TS on incoming SJOIN 2015-08-26 14:59:05 -07:00
James Lu
977b69b8e9 protocols/: Fix args parsing when the sender UID == the last argument
args.index() would return 0 instead of the index of the current argument.
2015-08-26 14:57:46 -07:00
James Lu
05be3e6c17 pr/: add prefixmodes in sjoinServer if TS <= theirs
The old comparison of our TS < theirs was wrong, because modes are merged (not dropped) when two channels of the same TS join.
2015-08-24 18:37:39 -07:00
James Lu
694e7b87f6 various: make the server description configurable
Two options for this: bot::serverdesc, and server::<network>::serverdesc, with the latter taking precedence if present.
2015-08-24 18:14:35 -07:00
James Lu
1d245bf001 protoocols.sjoinServer: only add prefix modes to channel state if our TS < theirs 2015-08-20 01:32:30 -07:00
James Lu
61d95c19cc protocols: delete empty non-permanent channels 2015-08-15 23:29:40 -07:00
James Lu
c99a6a7b9d protocols: update topic in channel state when sending outbound TOPIC 2015-08-15 22:34:40 -07:00
James Lu
06c466896e ts6: fix prefixmodes not being updated in sjoin 2015-08-15 20:14:36 -07:00
James Lu
4352a68357 Check for TS changes on SJOIN (both incoming and outgoing)
Restore relay to the devel branch; TS bursts shouldn't be handled there, but in the protocol modules.

TODO: fix prefixmodes being cleared after BURST, and never being reset?
2015-08-15 19:53:09 -07:00
James Lu
0d41e35d9c Merge branch 'devel' into wip/handle-ts-bursts
Conflicts:
	plugins/relay.py
2015-08-15 19:28:49 -07:00
James Lu
1a57dfcdc3 prs+IrcUser: add incoming (handle_away) and outgoing (awayClient) AWAY handling 2015-08-12 04:17:01 -07:00
James Lu
bf3116d704 First attempt at handling channel TS @ burst (#93)
Doesn't quite work yet, more testing needed.
2015-08-05 06:14:34 -07:00
James Lu
4d76593901 TS6: Initial support for elemental-ircd
The TS6 protocol gets some new options here: use_halfop, use_admin, use_owner, and use_elemental_modes, to deal with features
supported in Elemental but not charybdis. A second server block is added in the example config to document this.
2015-08-03 23:20:19 -07:00
James Lu
8a134aadc5 Remove duplicate assignment of irc.uidgen 2015-08-03 19:44:11 -07:00
James Lu
ddefd38591 ts6: fix the broken mess of a JOIN handler, and 'parse_as' handling in irc.callHooks... 2015-07-25 20:43:26 -07:00
James Lu
69e16e536b ts6: add QS as a required capability 2015-07-25 18:27:30 -07:00
James Lu
146ab5e444 ts6: support +AOS charybdis extension modes, warning if the IRCd doesn't support them
Also, add 'adminonly' (+A) to relay's whitelist.
2015-07-24 20:55:48 -07:00
James Lu
868b4503e6 protocols: Fix #81 - that was easy!
Split data by only one space at a time, not as many spaces as possible. Thanks to @nathan0.
2015-07-23 19:09:19 -07:00
James Lu
57c3a04cda ts6: call SQUIT hooks upon receving it... 2015-07-23 15:05:10 -07:00
James Lu
a77427ded9 ts6: fix SQUIT handling
These come in a different syntax? Strange.
2015-07-23 13:45:55 -07:00
James Lu
0575de1fac Support noctcp (+C) on charybdis, and wallops (+w) in relay 2015-07-23 13:45:38 -07:00
James Lu
254ccea0a3 remove some debugging cruft and unused imports 2015-07-23 11:46:45 -07:00
James Lu
42593ae431 ts6: add missing handler for SID 2015-07-23 11:17:57 -07:00
James Lu
58a8d7134c Fix handling of inbound CHG* 2015-07-23 11:02:32 -07:00
James Lu
2e34d9e85d ts6: Use EUID in spawnClient, and error on attempts to use plain UID
The latter isn't handled and thus would lead to pretty bad desyncs. Closes #79.
2015-07-23 10:22:55 -07:00
James Lu
8799e1ccc8 spawnClient: add ts as opt. argument; relay: spawn pseudoclients w/ TS of original user 2015-07-23 00:11:24 -07:00
James Lu
d52fba37b8 add numericServer for sending raw numerics from servers, and WHOIS handling in coreplugin
Basic WHOIS handling (user information, server information, IRCop access) are sent. #72

TODO: send channel lists, an extra note for relay clients, user modes, and idle time
2015-07-22 21:15:34 -07:00
James Lu
8a1f965303 Consistently use applyModes in spawnClient, so user modes are stored like ('o', None) instead of ('+o', None)
Drop the 'modes' argument in IrcUser, for this is incorrect.
2015-07-22 21:14:22 -07:00
James Lu
686467ffa6 Remove endburst toggling in spawnServer, has_bursted IrcServer flag
Neither are being used at all; they're essentially dead code.
2015-07-22 20:39:38 -07:00
James Lu
35cdfbf7e6 Declare IRCd casemapping in protocol modules, and respect these in utils.nickToUid
This adds a new utils.toLower(irc, text) function which returns the lowercased version of <text> based on <irc>'s declared case mapping.

Closes #75.
2015-07-22 20:31:45 -07:00
James Lu
bad1132789 ts6: fix users not joining channels properly due to command cutoff
https://github.com/grawity/irc-docs/blob/master/server/ts6.txt#L5-L6 states that there can only be 15 parameters max per command, GLOBALLY. Ugh.

No warnings? No clue whatsoever that the SJOIN is dropped? This wasted a lot of time.

COME ON.
2015-07-21 19:29:15 -07:00
James Lu
ea7681502f fix some bugs, introduce others 2015-07-21 17:33:36 -07:00
James Lu
57f8b0d6f7 ts6: add handler for BMASK (ban propagation on burst) 2015-07-21 14:38:53 -07:00
James Lu
9b8ef0a45d make relay and ts6 a bit less, well, buggy 2015-07-21 12:44:01 -07:00
James Lu
6ba42759cf ts6: manually set a timer for ENDBURST so relay's initializeAll works 2015-07-20 23:53:21 -07:00
James Lu
73c41b4363 relay & ts6: miscellaneous fixes? 2015-07-20 23:36:26 -07:00
James Lu
88dbe3cde9 TS6: misc fixes; finish off the basic protocol spec!
TODO: move the shared functionality with inspircd into a new ts6_common module
2015-07-20 22:31:40 -07:00
James Lu
419a39c89c ts6: implement initial connection, JOIN/EUID handlers, and more 2015-07-20 21:21:43 -07:00
James Lu
6a0a61296d ts6: handle_sjoin stub (untested) 2015-07-20 18:26:17 -07:00
James Lu
8234eb7304 Initial (incomplete and untested!!!) TS6 protocol stub (#40) 2015-07-20 17:36:43 -07:00