James Lu
e9fe15bd7d
[WIP] Further revise the persistent channels implementation
...
- Make dynamic_channels per plugin as well as per network to work around relay-service conflicts (#265 )
- Introduce ServiceBot.(add|remove)_persistent_channel() to add/remove persistent channels and optionally join/part them
- Introduce ServiceBot.part(), which checks remaining persistent channels list and parts a channel only if it is still not marked persistent
- Refactor automode to autojoin channels on ENDBURST instead of plugin load
- Refactor relay to manage persistent channels on join/part/(de)init, both locally (namespace 'relay_local') and remotely (namespace 'relay_remote')
2018-05-04 22:52:26 -07:00
James Lu
2f12a5b710
Initial work on dynamic service bot joining / parting ( #265 )
2018-04-12 12:45:33 -07:00
James Lu
655221491c
ServiceBot: log access denials to warning - closes #593
2018-04-07 20:22:55 -07:00
James Lu
3e656cd943
utils: mark reset_module_dirs, load_plugin, get_protocol_module as private
2018-03-02 20:23:47 -08:00
James Lu
1405b01597
ServiceBot: clean up some function descriptions
2018-02-18 19:40:46 -08:00
James Lu
5e92aefcd4
Implement priorities in utils.add_hook()
...
This changes world.hooks to store lists of tuples indicating (priority, hook_func).
2017-09-02 21:17:50 -07:00
James Lu
9e7af9ac3d
ServiceBot: migrate to irc.is_channel
2017-08-31 13:19:34 -07:00
James Lu
3922d44173
utils: rename remaining functions to snake case ( #476 )
2017-08-28 20:28:10 -07:00
James Lu
43b6566aa8
Move getDatabaseName from utils to conf ( #476 )
2017-08-28 20:27:39 -07:00
James Lu
e39b4e9c69
Move utils.is* methods into PyLinkNetworkCoreWithUtils ( #476 )
2017-08-28 20:07:31 -07:00
James Lu
2a7594e56e
Move PUIDGenerator->classes, IncrementalUIDGenerator->ircs2s_common ( #476 )
2017-08-28 19:42:24 -07:00
James Lu
b1159400f1
Move DeprecatedAttributesObject, CamelCaseToSnakeCase to structures ( #476 )
2017-08-28 19:36:55 -07:00
James Lu
ba649fb8b4
utils, exttargets: add checks for channel presence
2017-08-25 02:31:26 -07:00
James Lu
04cfa9c93e
ServiceBot: add altnick fetching capabilities to get_nick ( #288 )
2017-08-21 22:22:01 -07:00
James Lu
d28006ae62
Move ProtocolError to utils, and link the copy in classes to it
2017-08-21 22:21:09 -07:00
James Lu
89699051d5
Services API rework
...
- Move nick/ident/host/gecos fetching from services_support into functions
- Remove the unused 'ident' argument from ServiceBot
- Rename the 'nick' argument in ServiceBot to 'default_nick'
- Define default nicks for the PyLink, Automode, and Games services
2017-08-21 21:51:45 -07:00
James Lu
06d3de354e
utils: migrate to conf.conf['pylink']
2017-07-14 05:51:29 -07:00
Mitchell Cooper
7ab0e8f105
use isinstance() instead of type() where appropriate #410
2017-07-12 17:29:34 -04:00
James Lu
5ed4f8bf85
ServiceBot: break when trying to alias a command to itself
2017-07-10 22:18:01 -07:00
James Lu
63ce7ea407
ServiceBot: tweak display format for command aliases
...
Specifically: bold the command lists, add a space before, and be more specific with "alias for X".
2017-07-10 22:12:53 -07:00
James Lu
bf24bac9c9
ServiceBot: replace 'alias' option with 'aliases' & condense multiple add_cmds calls into one
2017-07-10 21:59:29 -07:00
Mitchell Cooper
f0379d79ef
mention that command is an alias or has aliases available in help command
2017-07-09 21:40:08 -04:00
Mitchell Cooper
20abac7461
hide aliases from command list
2017-07-09 21:23:52 -04:00
Mitchell Cooper
2299204efa
add alias argument to add_cmd()
2017-07-09 21:18:45 -04:00
James Lu
4e082c2bbf
PUIDGenerator: allow custom counter start values
2017-07-05 00:12:25 -07:00
James Lu
6d7e2c667d
DeprecatedAttributesObject: don't clobber __ variables
2017-06-30 21:38:50 -07:00
James Lu
8e9a99f90c
ServiceBot: migrate to snake case
2017-06-29 23:02:34 -07:00
James Lu
3913a909ef
utils: remove parseModes, applyModes wrappers
...
These have been deprecated since 0.8-alpha2.
2017-06-29 22:43:29 -07:00
James Lu
5647229c05
CamelCaseToSnakeCase: add deprecation warnings
2017-06-29 22:41:18 -07:00
James Lu
6684f9bf08
utils.CC2SC: slightly reword the "missing attribute" error
2017-06-27 16:26:53 -07:00
James Lu
91fe7e0ca7
utils.CC2SC: use self.__class__ to get the name of the current subclass
...
This is the intended behaviour instead of showing "CamelCaseToSnakeCase" in attribute errors.
2017-06-27 16:25:40 -07:00
James Lu
8f82b92a6a
utils: add CamelCaseToSnakeCase class, which wraps missing attributes from camel case names to snake case
2017-06-02 23:16:51 -07:00
James Lu
ed33c8d580
utils: add a default to DeprecatedAttributesObject so that it works as is
2017-06-02 17:26:54 -07:00
James Lu
a3df47e88e
ServiceBot: fix ce77f2cbd4
2017-05-07 17:33:15 -07:00
James Lu
ce77f2cbd4
ServiceBot: minor fix of logging syntax
2017-05-07 17:11:51 -07:00
James Lu
5d10ee39be
ServiceBot: make displaying unknown command errors optional
...
Closes #441 .
2017-03-28 22:18:51 -07:00
James Lu
c19ea74fb4
ServiceBot: ignore attempts to call empty commands
2017-03-20 22:22:43 -07:00
James Lu
f6d9765f87
core: implement module loading from user-defined directories
...
Closes #350 .
2017-03-08 22:31:57 -08:00
James Lu
805a0502d2
utils: add an alias (utils.IRCParser.REMAINDER) to argparse.REMAINDER
...
Reported by @IotaSpencer.
2017-03-08 10:02:46 -08:00
James Lu
225b0ac8b2
ServiceBot: catch InvalidArgumentsError for prettier error display on IRC
2017-03-06 16:30:43 -08:00
James Lu
ca93d1ad70
IRCParser: show an error when using "command --help" instead of silently outputting help text in the console
2017-03-06 16:30:43 -08:00
James Lu
76d74ab9bb
SECURITY: prevent DoS when calling --help on commands using IRCParser
...
argparse's default behaviour is to exit after displaying --help and --version information. However, doing so freezes the current IRC listener and essentially allows for DoS via IRC...
This bug does not affect any released (stable) version of PyLInk - only commits after 93c9b6289c
2017-03-06 16:11:04 -08:00
James Lu
7f070448b7
utils, Irc: add abstraction to warn on deprecated attribute usage ( #273 )
2017-03-05 00:00:26 -08:00
James Lu
e07974f803
utils: remove reference to checkAuthenticated() in NotAuthorizedError
2017-02-24 18:31:33 -08:00
James Lu
0125c544ee
utils: add an IRCParser class based off argparse, modified from @IotaSpencer's code
...
Closes #6 .
2017-02-21 21:45:43 -08:00
James Lu
75b5be5baf
ServiceBot: implement global and per-service spawn_service(s) options ( #403 )
2017-02-18 12:54:26 -08:00
James Lu
a776aab897
utils: ignore missing services in unregisterService instead of raising an error
...
This is a prerequisite for the next commit (service spawn toggle options). (#403 )
2017-02-18 12:54:08 -08:00
James Lu
2f968aca80
Irc: allow defaulting to private command replies ( Closes #409 )
...
Squashed commit of the following:
commit c168500235b65f833b1d7fe49ebde674159683ee
Author: James Lu <GLolol@overdrivenetworks.com>
Date: Thu Feb 16 17:33:36 2017 -0800
ServiceBot: default notice and private to None
This is so that it respects the changes from the last commit.
commit f685f3ef522f7f0ee356082c3c1b8b5a4e34b211
Author: James Lu <GLolol@overdrivenetworks.com>
Date: Thu Feb 16 15:10:33 2017 -0800
Irc: implement a prefer_private_replies option (#409 )
2017-02-16 17:41:07 -08:00
James Lu
ad873cfd7b
ServiceBot: be more flexible in help formatting
...
* Fix text after indented docstring line breaks not showing (thanks @IotaSpencer for noticing this)
* Update formatting so that multiple consecutive newlines in a docstring are shown:
- 2 newlines => 1 displayed new line
- 3 newlines => 2 displayed new lines, and so on...
2017-02-15 17:06:16 -08:00
James Lu
d33eb22ca3
ServiceBot: verify that the service name is a valid nick
2017-01-21 11:59:43 -08:00