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

377 Commits

Author SHA1 Message Date
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
James Lu
49943a7992 relay: only join PyLink to channels & set topics if there's actually a relay on the network 2015-07-17 21:51:30 -07:00
James Lu
3f6f78be9a relay + Irc: keep track of network disconnects
This introduces a new PYLINK_DISCONNECT meta-hook that is called when a network disconnects. Also, reset the state variables (i.e. servers, users, etc.) on disconnect! (this was missed before)

Closes #60.
2015-07-17 16:57:08 -07:00
James Lu
bc9863d9e0 Make reconnecting a bit less... broken 2015-07-17 16:20:41 -07:00
James Lu
fdea348cbe move hook calling out of pr/insp and into Irc 2015-07-17 16:09:50 -07:00
James Lu
df595c65a1 fix SQUIT not respecting autoconnect delay 2015-07-17 16:01:51 -07:00
James Lu
95853924ad Revert "protocols/: thread calls to each event hook to prevent blocking globally"
This reverts commit 99fd6060a7, which caused a bunch of race conditions in relay :/

Ref #59.
2015-07-17 15:13:57 -07:00
James Lu
f41e1a2eb5 Fixes for connection handling?
XXX: using SQUIT on the PyLink server doesn't respect autoconnect delays; why?
2015-07-17 15:08:24 -07:00
James Lu
836d0e9701 Irc: wrap (re)connecting in a while loop instead of calling it recursively
Also, remove unnecessary comments / ENDBURST hook from relay.

Ping handling seems to work fine now! Closes #57. Closes #42.
2015-07-17 14:37:07 -07:00
James Lu
99fd6060a7 protocols/: thread calls to each event hook to prevent blocking globally
Closes #59.
2015-07-17 14:35:02 -07:00
James Lu
9bef93c341 More stuff for PINGing uplink and autoreconnect (#42 #59 #57)
Doesn't quite work yet; still blocks everything on disconnect for some reason...
2015-07-17 13:41:14 -07:00
James Lu
0aa2f98705 Move client spawning, command / KILL / KICK handling outside the protocol module
New plugin 'coreplugin' takes care of command/KILL/KICK handling, while client spawning is moved into Irc.spawnMain() and is used by the former.

Closes #33.
2015-07-16 21:52:44 -07:00
James Lu
c6c24c242c Irc: fixes in timeout detection 2015-07-16 19:34:05 -07:00
James Lu
f1ef6f9e15 Irc: catch ConnectionError in both run() and send()
Part of #42.
2015-07-16 16:49:16 -07:00
James Lu
73c625a429 pr/insp: don't raise KeyError when removing channel from user fails 2015-07-16 16:48:54 -07:00
James Lu
2a586a6dba relay: don't send empty MODE commands if there are no supported modes left after filtering 2015-07-16 16:27:17 -07:00
James Lu
cf32461d8e relay: Only spawn clients if they share a channel, and quit them when they leave all shared channels
Closes #50.
2015-07-16 12:25:42 -07:00
James Lu
40fd9e37a0 relay: don't spawn tagged clones for the internal PyLink client 2015-07-16 12:25:33 -07:00
James Lu
d97fce8205 IrcUser & pr/insp: Implement user channel tracking 2015-07-16 12:20:40 -07:00
James Lu
35f1c88a4e relay: add hooks for CHGHOST / CHGIDENT / CHGNAME
Closes #49.
2015-07-16 11:53:40 -07:00
James Lu
f9d82153bb pr/insp: map FIDENT/FHOST/FNAME hooks to their CHG* counterparts 2015-07-15 23:23:46 -07:00
James Lu
643218efce README: fix link to issue tracker 2015-07-15 23:15:08 -07:00
James Lu
2f38b2b38d relay: handle squit, quitting the relevant relay pseudoclients with a fake netsplit message
This is hardcoded to *.net *.split, but it may change to show the split servers in the future...
2015-07-15 19:09:10 -07:00
James Lu
e413a21e68 pr/insp: send the list of affected users in handle_squit 2015-07-15 19:08:49 -07:00
James Lu
798476c850 pr/insp: don't crash when a server sends TOPIC 2015-07-15 19:08:36 -07:00
James Lu
c22c187717 Update README.md 2015-07-15 18:50:29 -07:00
James Lu
2106b8da3a main: add a note about irc.connected.wait() and maxnicklen being set 2015-07-15 14:00:40 -07:00
James Lu
cd244ee89b relay: block until irc.maxnicklen is set, and remove check for "nick already in use" for internal clients
Closes #48. This fixes the edge case where, if a person with a long, cut-off nick changes to another long nick, and the resulting normalized nick is the same,
normalizeNick will start incrementing the separator anyway. The correct behavior is to NOT send any nick changes if the old (normalized) nick and the new nick
match.
2015-07-15 13:53:14 -07:00
James Lu
6e37e1c05d make Irc.connected a threaded event object, setting it to True ONLY when we receive server capabilities from our uplink
The previous behavior set this to True as soon as we ran connect(), but this caused problems because the default capabilities (i.e. nicklen)
that Irc() initializes won't match the real value of the network.
2015-07-15 13:49:12 -07:00
James Lu
8d914720b3 It might be useful to expose such options in the example conf, you know 2015-07-15 11:53:07 -07:00
James Lu
293bfff813 main: thread Irc.connect() and begin work on autoreconnection 2015-07-15 11:52:36 -07:00
James Lu
bbe71e22ab relay: fixes for NICK and TOPIC propogation 2015-07-15 11:48:26 -07:00
James Lu
e3e643de54 relay: don't try to spawn clients on disconnected networks (those raise errors) 2015-07-15 11:48:03 -07:00