ConnectionAdd

From TrillWiki

Jump to: navigation, search

The connectionAdd function will create a connection for a particular medium. The connection id must be a unique value for that medium and not repeat for new connections within that Trillian load. A connection in Trillian may not always be 'connected'. They are created to allow the user to have ease of accessing a particular account and can disconnect/reconnect at will until the connection is removed.

Compatibility: 2.0 and higher

Contents

Syntax

plugin_send(MYGUID, "connectionAdd", struct connection_entry_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

ConnectionAdd utilitizes the connection_entry_t structure.

struct connection_entry_t {  
 	unsigned int			struct_size; 
 
 	char				*medium; 
 
 	int				connection_id; 
 
 	char				*name; 
 	char				*status; 
 
 	/* 2.0 
 	 */ 
 	char				*section; 
 	struct menu_entry_t		*menu_entry; 
 };



medium
The medium for this particular connection.
connection_id
A unique number representing the connection (ie: start at 1 and increase by one throughout the plugin load).
name
The name associated with this connection (most likely the account name).
section
The section associated with the connection. Each account should have a section associated with it. A NULL section uses the default contact list.
menu_entry
The menu associated with this connection.


Return Value

Negative value on error, 0 on success.

Remarks

Be sure to remove a connection using connectionRemove when the plugin is stopped.