[dev] [en] recommendations + text commands
Goffi
goffi at goffi.org
Lun 24 Mar 13:23:42 CET 2014
G'day,
I have added a new "recommendations" field for plugins in PLUGIN_INFO: if a
plugin is in recommendations instead of dependencies, it will be treated as a
dependecy (loaded if needed), but if it can't be found no exception will be
raised (i.e. it's not a mandatory plugin).
A use case is text commands: before, text-commands plugin was implementing
everything, including commands like "join" which is linked to XEP-0045, so
XEP-0045 was a dependency of text-commands. Now, text-commands has no more
dependency, and it's a recommendation of plugin XEP-0045: if it's available,
XEP-0045 will add its own commands, else there just a warning in the logs
telling that commands are not available.
2 new methods are in text-commands:
- registerTextCommands which look in an instance for every method name
"cmd_.*", and add them as text command (the docstring is used for /help).
- addWhoIsCb, which can be used by plugin to add information to /whois
command. Software version add client name/version and OS used with this
method.
cheers
Goffi
Plus d'informations sur la liste de diffusion dev