James Lu
5122aa8f9a
utils: add unregisterService
2016-05-14 14:52:12 -07:00
James Lu
8f14e02f10
utils: return the ServiceBot instance in registerService
2016-05-14 14:23:52 -07:00
James Lu
6440922759
ServiceBot: disable request/remove commands by default
...
These are stubs at the moment, but still.
2016-05-14 14:15:46 -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
5b3059c85d
ServiceBot: fill in 'help' and 'list' commands ( #216 )
2016-05-14 12:22:00 -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
0c7faed213
Move NotAuthenticatedError class back into utils
...
This is needed because ServiceBot exists in utils, and utils cannot import classes without a bad import loop happening.
2016-05-14 10:05:18 -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
3bb1208e74
core: move toLower to Irc ( #199 )
2016-04-30 16:57:38 -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
064cb9b6aa
core: move reverseModes, joinModes into Irc
2016-04-30 16:33:46 -07:00
James Lu
f1351bb3f5
utils: introduce deprecation warnings for applyModes and parseModes
2016-04-24 21:44:34 -07:00
James Lu
84822fb1d6
Move applyModes, parseModes into Irc, suppressing deprecation warnings for now ( #199 )
2016-04-24 21:44:27 -07:00
James Lu
7f46e1c35c
Separate KeyedDefaultdict into new structures module ( #199 )
2016-04-24 21:11:36 -07:00
James Lu
2c60aa6395
Separate UID/SID generators into various protocol modules ( #199 )
2016-04-24 21:08:07 -07:00
James Lu
dc1d9602e9
utils: add a simple P10 UID generator ( #87 )
...
Reference: https://github.com/evilnet/nefarious2/blob/a29b631/doc/p10.txt#L85-L92
2016-04-05 18:45:00 -07:00
James Lu
e2edc68fe8
utils: check explicitly for "pos is None", as 0 is a falsey value too
...
Without this, the UID generator would refuse to change the left-most character of the UID, as it is position 0.
2016-04-05 18:44:00 -07:00
James Lu
cb8ea473df
utils: modularize UID generators
2016-04-05 18:05:52 -07:00
James Lu
305db9f754
utils: also don't crash in applyModes for bad mode targets
2016-03-26 18:14:53 -07:00
James Lu
e70dfb0811
Merge branch 'master' into devel
2016-03-26 17:58:18 -07:00
James Lu
2169a9be28
utils: actually abort when mode target is invalid
2016-03-26 17:58:03 -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
03b53aee59
Merge branch 'staging' into devel
2016-03-25 15:03:05 -07:00
James Lu
0fd093644c
utils: don't crash when mode target is invalid
2016-03-23 18:04:12 -07:00
James Lu
d84cfbcda1
utils: simplify prefix modes handling in applyModes
2016-03-19 17:47:23 -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
544d6e1041
utils: add KeyedDefaultdict
...
This is a subclass of defaultdict allowing the key to be passed to the default factory.
2016-03-19 17:01:16 -07:00
James Lu
14388d932f
utils.getHostmask: add option to return IP address
2016-03-05 09:52:00 -08:00
James Lu
0430e1dae7
utils.getHostmask: option to return hostmask with real host, use placeholders w/o spaces in them
2015-12-31 18:09:52 -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
11adee9d78
Yet another documentation refresh ( #113 )
2015-12-26 14:45:28 -08:00
James Lu
9a81a2ba1f
Rename utils.getProtoModule => utils.getProtocolModule
2015-12-24 17:33:49 -08:00
James Lu
31c47b50f3
utils: fix irc.users changing size during lookup
2015-12-11 18:43:58 -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
561af2e037
utils/relay: add and use getDatabaseName to fetch an instance-specific DB name
2015-12-06 17:13:47 -08:00
James Lu
197532c1be
core: Replace imp (deprecated) with importlib, reword some docs & remove unneeded imports
2015-11-22 20:14:47 -08:00
James Lu
b3ab604b88
utils: return the bound function in add_cmd/add_hook
...
TODO: allow utils.add_cmd/add_hook to be called as a decorator WITH a name argument
2015-10-23 18:47:11 -07:00
James Lu
c0eab152e4
utils: fix error handling in parseModes
2015-10-08 20:59:31 -07:00
James Lu
b8fe622cc8
utils: don't allow hostmasks/banmasks to have # in them
2015-10-08 17:25:49 -07:00
James Lu
e84a2d1025
Modularize our import hacks, make Irc() take a conf object again
2015-09-28 19:12:45 -07:00
James Lu
bbedd38703
world: rename command_hooks=>hooks, bot_commands=>commands
2015-09-27 10:53:25 -07:00
James Lu
5afa621654
utils.parseModes: add missing string formatting
2015-09-25 20:25:41 -07:00
James Lu
da3251cce2
utils.parseModes: check to make sure target channel/user exists
2015-09-25 20:25:30 -07:00
James Lu
e92f35018f
TS6SIDGenerator: take an IRC object, and skip any SIDs that are currently in use
2015-09-20 18:32:43 -07:00
James Lu
069cd62865
core: allow marking spawned clients as manipulatable or protected
...
This flag determines whether the client should be manipulated by commands like bots.py's MODE/QUIT/JOIN commands, or protected from them (services).
2015-09-17 19:01:54 -07:00
James Lu
48573b6033
utils.parseModes: autoconvert nicks->UIDs for prefix modes, skipping if the target doesn't exist.
2015-09-14 17:57:20 -07:00
James Lu
b0b9138720
Merge branch 'master' into devel
2015-09-14 17:56:53 -07:00