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

58 Commits

Author SHA1 Message Date
James Lu
264c803d8e coreplugin: modularize rehash, and add a SIGHUP handler for it
Closes #179.
2016-04-09 10:08:32 -07:00
James Lu
8f32727a3f Move rehash into core (Closes #178) 2016-04-09 09:54:04 -07:00
James Lu
58519011b8 coreplugin: modularize shutdown routines, handle SIGTERM->shutdown
Ref: #179
2016-03-27 21:46:10 -07:00
James Lu
c71d2bfcb9 coreplugin: sync opertype changes in handle_operup 2016-03-26 13:14:01 -07:00
James Lu
9278e56dd8 coreplugin: normalize WHOIS output format 2016-03-26 13:13:55 -07:00
James Lu
00552a41a7 Move detailed version string generation to utils
New function: utils.fullVersion(irc)
2016-03-26 11:33:47 -07:00
James Lu
23056e97e3 protocols & coreplugin: add handlers for VERSION requests 2016-03-26 11:27:07 -07:00
James Lu
c176c90bb6 coreplugin: use IrcChannel.getPrefixModes in whois replies 2016-03-19 18:08:19 -07:00
James Lu
8135f3a735 core: Depluralize prefixmodes mappings (#168)
This is an API breaking change. I really don't know why I made these keys plural to start, since it only made things more complicated. Prefix modes are not pluralized in the list of supported modes of each IRCd.
2016-03-19 17:25:04 -07:00
James Lu
3527960d18 coreplugin: tell plugins to exit cleanly before closing connections
Relay tends to hang on shutdown unless it's specifically told to exit/unload first. This is probably a better solution, as it works with other plugins too.
2016-03-05 10:22:00 -08:00
James Lu
4df027cac4 coreplugin: ignore services' attempts to send accountname before user introduction
This happens in the case of SASL on InspIRCd+atheme, for example.
2016-03-04 12:23:07 -08:00
James Lu
40d76c8bb6 coreplugin: demote successful oper-up messages to debug 2016-02-20 18:45:11 -08:00
James Lu
0fff91edfd ts6: implement services account tracking (#25)
This adds a new protocol hook: [user_logging_in, 'CLIENT_SERVICES_LOGIN', {'text': account_name}], sent whenever someone logs in to services. Actual state tracking is done in coreplugin.py
2016-02-07 18:38:22 -08:00
James Lu
5ccf204c75 protocols: consolidate modeClient and modeServer into mode() 2016-01-16 17:08:17 -08:00
James Lu
196282db86 protocols: numericServer(...) -> numeric(...) 2016-01-16 16:47:35 -08:00
James Lu
acdd7dbb78 protocols: rename joinClient(...) -> join(...) 2016-01-16 16:36:45 -08:00
James Lu
989f1f4f64 plugins: use irc.disconnect() to disconnect networks (#152) 2016-01-09 20:25:51 -08:00
James Lu
f70ca54ae4 classes: IRC object disconnect tweaks (really fixes #152)
- disconnect() was missing a socket.shutdown() cause, as socket.close() does NOT cause connections to close immediately! https://docs.python.org/3/library/socket.html#socket.socket.close
- Merge _disconnect() and disconnect(), the latter was just a wrapper with little use
2016-01-09 20:04:10 -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
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
4d0f346340 coreplugin: code formatting, show AWAY statuses in WHOIS
Closes #143.
2015-12-17 21:51:15 -08:00
James Lu
e4fb64aeba Document more parts of the core - comments are cool right 2015-12-06 17:40:13 -08:00
James Lu
c5acd5cd38 coreplugin: uhhh, fix typo in irc.connected check 2015-11-26 22:43:37 -08:00
James Lu
2080a39cf4 coreplugin: sanity check: make sure irc.connected is set after 2 seconds & mention how setting this is neccessary in docs 2015-11-15 21:50:23 -08:00
James Lu
7b444a72d8 coreplugin: log plugin loading/unloading to INFO 2015-10-25 10:39:47 -07:00
James Lu
5bccfcd170 coreplugin: log successful operups to INFO
TODO: Investigate why this doesn't work on charybdis/TS6...
2015-10-23 19:08:03 -07:00
James Lu
5ff82274e4 coreplugin: normalize logging punctuation for logins 2015-10-23 19:07:39 -07:00
James Lu
17a2dcd21f plugins: use irc.reply(...) instead of irc.msg(irc.called_by, ...) whereever possible 2015-10-23 18:29:10 -07:00
James Lu
d14cf3c7cf Move (un|re)?load, identify commands to coreplugin
This is so the commands plugin, which includes other generic (but not essential) commands, can be more easily reloaded.
2015-10-23 18:22:29 -07:00
James Lu
bd85e1fa82 coreplugin: block attempts to call commands (in PM) from PyLink bots 2015-10-02 23:41:49 -07:00
James Lu
822544e3cc core: keep track of where last command was called & make command calling a shared function
Prerequisite for FANTASY command implementation (#111).
2015-09-26 10:20:23 -07:00
James Lu
16d8a2212a coreplugin: protect the main PyLink client too, even though it's technically manipulatable 2015-09-20 16:55:04 -07:00
James Lu
f110ac15b0 coreplugin: Protect against forced deopers
Closes #67.
2015-09-20 13:21:04 -07:00
James Lu
4c45533ecb coreplugin: send the RIGHT server desc in WHOIS replies 2015-09-20 12:11:28 -07:00
James Lu
f38958995c Store opertypes with spaces instead of underscores, and only change them back when sending OPERTYPE
Another "Janus sucks" commit - it should be always using underscores when sending OPERTYPE, but it doesn't...
2015-09-20 11:25:45 -07:00
James Lu
c77f92357a coreplugin: show real IP/host in WHOIS 2015-09-19 10:25:50 -07:00
James Lu
394d4f7f1d coreplugin: reply with the *right* server name in WHOIS 2015-09-06 22:40:22 -07:00
James Lu
62e7cc4fca move utils.msg() => classes.Irc.msg()
New function gets an extra (optional) "source" argument for specifying a sender UID. It's also shorter since no IRC object has to be passed to utils.
2015-09-06 22:23:44 -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
2c4a88b9be coreplugin: catch NotAuthenticatedError in a prettier way 2015-09-02 23:37:54 -07:00
James Lu
26e102f01a Show oper types on WHOIS 2015-08-31 14:52:56 -07:00
James Lu
e1e31f64ad Allow multiple plugins to bind to one command name!
They will get called in a list, one after the other. The "help" command is able to distinguish with this too.
2015-08-29 19:25:07 -07:00
James Lu
973aba6de7 Move utils' global variables to world.py 2015-08-29 09:39:33 -07:00
James Lu
bc7765b241 Let's use consistent "Unknown command" errors, right? 2015-08-25 20:51:13 -07:00
James Lu
7e449aaada coreplugin: Don't stop iterating if one WHOIS handler errors 2015-08-24 18:40:31 -07:00
James Lu
0d497a8f72 coreplugin: show channel prefixes in WHOIS reply 2015-08-24 18:37:46 -07:00
James Lu
af02af6b4a coreplugin: send WHOIS lines in a more standard order 2015-08-24 18:27:18 -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
3fc5896f82 Strip leading/trailing spaces when handling PM commands 2015-08-18 05:49:27 -07:00
James Lu
821f546f12 Make sure the PyLink client rejoins all relay channels on KILL
This adds a new internal hook, 'PYLINK_SPAWNMAIN', which is triggered whenever Irc().spawnMain() is called.
2015-08-18 05:44:36 -07:00