EditAliasRegister

From TrillWiki

Jump to: navigation, search

Aliases are commands that can be used within the edit area of message windows. Aliases can be whatever the plugin chooses; for example, the Winamp 2.x plugin binds the text block "/music" to "/me is listening to (song)".

Although plugin writers may alias any block of text that they wish, it is recommended that the "/<command>" standard be adhered to.*

Upon receiving this command, Trillian will notify the plugin and ask for the appropriate replacement text.

Compatibility: 1.0 and higher

Contents

Syntax

plugin_send(MYGUID, "editAliasRegister", alias_t *)

Note that all Trillian functions and notifications begin with a lower-case letter, despite the Wiki requirement that all pages start with a capital letter.

Parameters

EditAliasRegister utilitizes the alias_t structure.

struct alias_t { 
 	unsigned int   			struct_size; 
 
 	int     			alias_id; 
 
 	char				*text; 
 
 	ttkCallback			callback; 
 
 	void				*data; 
 };



alias_id
This value is filled by the aliasRegister function and should be 0 when called.
text
The alias text to match, such as "/music". This should not have any spaces.
callback
Callback for the generated notifications when an alias is used by a user.
data
Data passed to the callback in the user parameter.


Return Value

The alias ID for the alias just registered.

Remarks

All alias's registered must be removed properly by the plugin before it is unloaded. Not doing this may result in a crash.

NOTE: For aliases that do not start with the forward slash, it seems that a bug causes the registration to succeed, but the callback to never be invoked.


See also: Alias Notifications

Personal tools