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

40 Commits

Author SHA1 Message Date
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
James Lu
3b67ddfee6 coreplugin: use a more standard "End of WHOIS" message
"End of /WHOIS list" seems relatively standard: it's used by InspIRCd, charybdis, and UnrealIRCd.
2015-07-24 11:13:53 -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
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
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
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