ContactlistSubcontactAdd

From TrillWiki

Jump to: navigation, search

The contactlistSubcontactAdd function adds a subcontact to a contact already existing in the contact list. A subcontact is a contact placed beneath a normal contact and could be used for things like resources on jabber or other uses (ie: mail received from that client, etc).

Compatibility: 2.0 and higher

Contents

Syntax

plugin_send(MYGUID, "contactlistSubcontactAdd", struct contactlist_subcontact_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

ContactlistSubcontactAdd utilitizes the contactlist_subcontact_t structure.

struct contactlist_subcontact_t { 
 	unsigned int			struct_size; 
 
 	struct contactlist_entry_t	*parent; 
 	struct contactlist_entry_t	*subcontact; 
 };



parent
The main contact in which to add the subcontact for. This requires the real name (or uri), section and medium to be filled out.
subcontact
The information for the subcontact. Please look at the contactlistAdd function to know which fields must be filled out and what each one means.


Return Value

Negative value on error, 0 on success.

Remarks

Please note that the subcontacts are not saved when Trillian exits. It is the responsibility for the plugin to readd these with each new load.

Be sure to NULL out the menu and callback when the plugin stops.


Personal tools