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

632 Commits

Author SHA1 Message Date
James Lu
58a8d7134c Fix handling of inbound CHG* 2015-07-23 11:02:32 -07:00
James Lu
1efc9018f3 main: raise fallback ping frequency to 30 2015-07-23 10:28:28 -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
44e07b0c2f relay: don't error if the WHOIS target isn't a relay user... oops 2015-07-23 00:10:54 -07:00
James Lu
88c85c8475 coreplugin/whois: only show user modes to opers 2015-07-23 00:05:05 -07:00
James Lu
a7f977aa3b Add whois handlers for channel lists, user modes, and signon time, and relay user information
New API: utils.whois_handlers allows one to add functions taking (irc, target) and returning (irc numeric, reply text)

Closes #72.
2015-07-23 00:01:51 -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
8c1e1c18f1 relay: Factorize relayJoins usage in initializeChannel and truly fix #74.
Squashed commit of the following:

commit 4e481f15db372d5c07f30e92f6581ea93692695b
Author: James Lu <GLolol1@hotmail.com>
Date:   Wed Jul 22 19:28:34 2015 -0700

    relay: Factorize relayJoins usage in initializeChannel and truly fix #74.

    The real error was that queued_users was being defined in the wrong spot (outside of the for loop),
    so the user list would grow larger and larger with every network initialized.

    This reverts parts of the previous commit which weren't actually necessary.

commit 76cc6bfbc71439880f01891f944600a26ff81130
Author: James Lu <GLolol1@hotmail.com>
Date:   Wed Jul 22 13:34:47 2015 -0700

    Mark users as internal at the IrcUser level (attempt to fix #74)
2015-07-22 19:29:58 -07:00
James Lu
3eb54c479a admin: clearer command help? 2015-07-22 13:18:11 -07:00
James Lu
f5f031e41b config.yml.example: add header and note about comments
Apparently this isn't obvious enough for some. Figures. :|
2015-07-22 11:46:38 -07:00
James Lu
c889cf6513 relay: only check for duplicate modes if prefix is '+' 2015-07-21 23:58:28 -07:00
James Lu
48aa0c3160 relay: rebase "no duplicate modes" branch over devel
Conflicts:
	plugins/relay.py
2015-07-21 23:55:28 -07:00
James Lu
7b84bda11b relay: refactor getLocalUser to accept a targetirc argument; fix MODE and KICK relaying
Closes #76.
2015-07-21 23:53:59 -07:00
James Lu
a1fc6d6734 relay: attempt to fix kick relaying (#76) 2015-07-21 22:14:53 -07:00
James Lu
6abb56921e relay: fix DELINK delinking more networks than the current one 2015-07-21 20:18:35 -07:00
James Lu
a04bce99c1 fix 8f13ae77, again... 2015-07-21 20:13:43 -07:00
James Lu
e2738e3909 utils.applyModes: fix prefixmodes lists not being updated... 2015-07-21 19:57:22 -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
3b79adf4e5 relay: Fix remoteuser being None for spawned pseudoclients
We're supposed to ignore these anyways... Closes #74.
2015-07-21 19:29:09 -07:00
James Lu
8f13ae778a Fix regression in 024ac165 that caused channel messages to only be sent to one other net, instead of all relay links 2015-07-21 19:27:41 -07:00
James Lu
ea7681502f fix some bugs, introduce others 2015-07-21 17:33:36 -07:00
James Lu
c0f82597a5 relay: don't spawn new pseudoclients for mode changes 2015-07-21 16:07:09 -07:00
James Lu
f5df4008f4 README: we now support inspircd 2.0 and charybdis; mention that.
Closes #40.
2015-07-21 15:42:09 -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
badbcf0507 Irc.callHooks: allow handlers to specify which hook to call via a special 'parse_as' key
For special cases such as "/join 0", where the PART handler has to be called instead of JOIN.
2015-07-20 21:19:15 -07:00
James Lu
6efb59b8b7 Irc: strip off \r from lines 2015-07-20 21:19:01 -07:00
James Lu
b593b39421 Merge branch 'devel' into wip/proto-ts6 2015-07-20 19:54:08 -07:00
James Lu
72be5ca79c inspircd: make handle_part return a list of channels, not just one
Some IRCds, like TS6, allow sending multiple channels (as a comma-separated list) in PART.

Update relay accordingly.
2015-07-20 19:52:52 -07:00
James Lu
6a0a61296d ts6: handle_sjoin stub (untested) 2015-07-20 18:26:17 -07:00
James Lu
3494d4f794 inspircd: remove RSQUIT handler
Events like this shouldn't be handled at the protocol level, ever. There's little point in adding this globally, since plugins should be able to choose what happens when they receive an SQUIT.
2015-07-20 18:05:42 -07:00
James Lu
8234eb7304 Initial (incomplete and untested!!!) TS6 protocol stub (#40) 2015-07-20 17:36:43 -07:00
James Lu
ef3aab69f2 relay: make '/' support in nicks explicit instead of implicit 2015-07-20 16:50:18 -07:00
James Lu
a10a18d9cc Irc: make prefixmodes a dict mapping chars to their prefixes
This is needed by TS6 support (#40), which send the characters (@+) instead of modes
2015-07-20 16:48:59 -07:00
James Lu
65ef27fd4b relay: initial nick collision handling via SAVE (Closes #61) 2015-07-20 14:37:04 -07:00
James Lu
ad34f6c4f9 relay: make separator a per-network config option 2015-07-20 14:36:47 -07:00
James Lu
2bc0a65128 relay: hack to support sending to @#channel, etc. 2015-07-20 13:45:15 -07:00
James Lu
b1e409ff3e relay: unbreak topic handling (closes #68)
Introducing a new .topicset attributing in IrcChannel denoting whether we've received a TOPIC for this channel from the uplink yet.
2015-07-20 13:18:04 -07:00
James Lu
e76d31d14e relay: fixes to KICK handling, don't allow spawning new pseudoclients for trivial tasks like TOPIC or PART
This introduces a new spawnIfMissing option in getRemoteUser, which defaults to True and toggles spawning new pseudoclients if one is not found for a certain network.
In the case of TOPIC or PART being sent, we'll want this turned off because we can either 1) route these through our PyLink server SID, or 2) ignore these entirely.

For KICK handling, this commit fixes kicks sent from servers or clients that don't have a pseudoclient on the target network, by tagging them in the message and routing them through our main PyLink SID.
Normal kicks still behave as usual:

* You have been kicked from #endlessvoid by GLo|o|/ovd (test)
* You have been kicked from #endlessvoid by pylink-devel.overdrive.pw ((ChanServ/ovd) (GLo|o| (GLolol)) test)
* You have been kicked from #endlessvoid by pylink-devel.overdrive.pw ((some.server.name/ovd) No reason given)
2015-07-19 23:49:50 -07:00
James Lu
06d17d578b Irc: prevent rare UnicodeDecodeError by decoding individual lines, not the entire socket.recv() output
Such an error is rare, but it did occur twice since I've started developing this :)
2015-07-19 23:46:31 -07:00
James Lu
fe9c317f2c inspircd: make channel user tracking more fault tolerant (in sjoinServer / handle_part) 2015-07-19 23:46:19 -07:00
James Lu
fd736b383f relay: add user mode handling based on a whitelist of modes
Closes #64.
2015-07-19 22:43:26 -07:00