3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-18 08:02:51 +01:00
Commit Graph

71 Commits

Author SHA1 Message Date
James Lu
7cc5988dac coreplugin: spawn main client as manipulatable 2016-05-14 14:14:44 -07:00
James Lu
32bc5f120b core: migrate the main client to ServiceBot (#216)
- irc.spawnMain is dropped. Clients are now spawned in the endburst loop, after protocol negotiation completes. This allows PyLink to spawn clients with hideoper, etc., closing #194.
- utils.add_cmd and irc.callCommand are now just wrappers around world.services['pylink'].add_cmd and call_cmd respectively.
- coreplugin registers the main client while it is loaded up, before any commands are added.
2016-05-14 13:29:23 -07:00
James Lu
118d76fd5a core: allow defining service bots with custom nicks/idents 2016-05-14 12:52:32 -07:00
James Lu
bb265189a4 coreplugin: handle kicks and kills to service bots
Also, rename handle_newservice() to spawn_service(). The latter is more general as this function is reused by other handlers too.
2016-05-14 12:37:06 -07:00
James Lu
aa05dcd112 coreplugin: set invisible (umode +i) on service clients 2016-05-14 12:01:12 -07:00
James Lu
f1e22685b2 coreplugin: fix typo
We're looking up user modes, not channel modes.
2016-05-14 10:27:49 -07:00
James Lu
924172291f ServiceBot: work out basic command handling
This copies callCommand from the IRC object into ServiceBot.call_cmd. The former will be removed once the main PyLink client is migrated to a service bot.
2016-05-14 10:17:40 -07:00
James Lu
7d11f8c7e0 Begin work on service bot abstraction (#216)
- State-keeping is done by coreplugin
- utils.registerService() introduced
- new PYLINK_NEW_SERVICE hook introduced
2016-05-14 09:55:46 -07:00
James Lu
beae4eea9e core: rename utils.fullVersion -> irc.version (#199) 2016-04-30 17:00:28 -07:00
James Lu
2fe2e9c8c4 core: move isOper, checkAuthenticated to Irc (#199) 2016-04-30 16:54:11 -07:00
James Lu
78f8a2fc8d core: move isManipulatableClient, getHostmask to Irc 2016-04-30 16:44:37 -07:00
James Lu
ef4cb8b773 coreplugin: remove irc.connected check
This is misleading when the network fails to connect at daemon start, for example. Reverts parts of c5acd5c and 2080a39.
2016-04-30 16:37:12 -07:00
James Lu
064cb9b6aa core: move reverseModes, joinModes into Irc 2016-04-30 16:33:46 -07:00
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