66854bc204
The user command (UCMD) extension to the ADC protocol allows for sending hub-specific commands to clients. These commands have a name (which generally appears in a menu in the client) and a command string which the client sends back to the hub when the command is selected. These command strings can contain keyword substitutions for useful information, such as the SID of another user that was selected in the client. This commit adds some support for sending user commands to the uhub plugin API. It currently restricts the command string to containing main chat messages (BMSG commands in ADC parlance). A plugin_ucmd structure is added to store the details of a user command, and four methods are added to the plugin_handle.hub structure: * plugin->hub.ucmd_create(plugin, name, length) creates a new user command. * plugin->hub.ucmd_add_chat(plugin, ucmd, message, me) adds a main chat message to the list of commands to be run when the user command is selected. The me flag allows IRC /me style messages. * plugin->hub.ucmd_send(plugin, user, ucmd) sends the command to a user. * plugin->hub.ucmd_free(plugin, ucmd) frees the memory taken by a user command. The structure has a number of flags (categories, remove, separator, constrained) which correspond to the flags in the UCMD specification. The categories flag must be set prior to sending to one (or more, via a logical OR) of the ucmd_category_* enumeration values defined in plugin_api/types.h. The PLUGIN_API_VERSION has been increased to 2 to mark the change. |
||
---|---|---|
admin | ||
autotest | ||
debian | ||
doc | ||
src | ||
thirdparty | ||
tools | ||
vs2010 | ||
.gitignore | ||
.gitmodules | ||
AUTHORS | ||
BSDmakefile | ||
BUGS | ||
ChangeLog | ||
COPYING | ||
COPYING.OpenSSL | ||
GNUmakefile | ||
README | ||
TODO | ||
version.h |
Welcome and thanks for downloading uHub, a high performance ADC p2p hub. For the official documentation, bugs and other information, please visit: http://www.uhub.org/ For a list of compatible ADC clients, see: http://en.wikipedia.org/wiki/Advanced_Direct_Connect#Client_software