3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 23:09:23 +01:00
Commit Graph

359 Commits

Author SHA1 Message Date
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
James Lu
8cde2ddce7 utils.applyModes: don't crash if existing modelist is a list, not a set 2015-07-19 22:42:04 -07:00
James Lu
bf444f3f6a pr/insp: Servers should use FTOPIC, not TOPIC to send topics 2015-07-19 17:27:53 -07:00
James Lu
4078cef3e4 relay: base mode relaying off a whitelist (closes #54)
Modes that aren't standard/safe (e.g. ojoin +Y, permchan +P, various anti-flood modes) are simply ignored.
2015-07-19 16:53:51 -07:00
James Lu
0cb9065d53 pr/insp: coerse 'reginvite' named mode to 'regonly' 2015-07-19 16:53:51 -07:00
James Lu
0540e10d50 relay: don't add bans that don't match nick!user@host
Closes #55.
2015-07-19 16:53:51 -07:00
James Lu
fbc2fbf595 log: replace existing log files instead of appending 2015-07-19 16:52:58 -07:00
James Lu
57e9bf601e Log command usage, 'exec' usage, successful logins, and access denied to commands in admin.py
Closes #66.
2015-07-19 15:01:49 -07:00
James Lu
1b09a00ea9 utils: add getHostmask 2015-07-19 15:01:49 -07:00
James Lu
c00da49477 relay: add 'save' command, make rescheduling optional in exportDB() 2015-07-19 15:01:49 -07:00
James Lu
688675d484 relay: don't relay messages sent to the PyLink client 2015-07-19 11:27:57 -07:00
James Lu
00e28047f7 Make sure log/ exists 2015-07-18 20:13:53 -07:00
James Lu
536366de99 main/coreplugin: use log.exception() instead of traceback.print_exc()
This fixes tracebacks only being sent to console, and not the log file.
2015-07-18 20:12:13 -07:00
James Lu
61804b1ecd log: also log to $curdir/log/pylink.log
Closes #52.
2015-07-18 20:11:29 -07:00
James Lu
b6275130e1 Irc: catch AttributeError when self.socket doesn't exist (failed to establish initial connection) 2015-07-18 20:10:33 -07:00
James Lu
024ac165a8 relay: Only allow messaging users in common channels / channels that you're in
The old behavior, which iterated over the pseudoclients representing the sender, dropped messages to clients without a common channel without any warning. Now, the sender will get a lovely notice from the PyLink client.

Trying to send to a '-n' channel without being in it:
	-PyLink-devel- Error: You must be in '#channel' in order to send messages.

Trying to message a user without sharing a common channel:
	-PyLink-devel- Error: You must be in a common channel with 'GLolol/testnet' in order to send messages.

Closes #62.
2015-07-18 12:24:12 -07:00
James Lu
d30890c5cd relay: fix "RuntimeError: dictionary changed size during iteration" in handle_part 2015-07-18 12:21:46 -07:00
James Lu
ccf759679b relay: fix the wrong modes being propagated to the wrong channels
tl;dr, this was two bugs in one! Closes #53.
2015-07-18 12:06:58 -07:00
James Lu
64adb79120 example conf: mention pingfreq and disabling autoconnect 2015-07-17 23:44:52 -07:00
James Lu
a51cfcb7b2 Fix fakeirc and tests for relay (#56) 2015-07-17 22:52:55 -07:00
James Lu
4553eda6ec plugins/admin & relay: Add help for commands 2015-07-17 22:35:34 -07:00
James Lu
50665ec601 commands: remove 'debug', it's useless now that 'exec', 'showchan', and 'showuser' exist 2015-07-17 22:21:57 -07:00
James Lu
6508cb3c38 commands: add a 'help' command (closes #8)
Fetch the docstring of the command function if it exists, and format appropriately.
2015-07-17 22:21:16 -07:00
James Lu
bbcd70b175 relay: add 'linked' command (closes #65) 2015-07-17 22:00:25 -07:00