MessageNicklistAdd

From TrillWiki

Jump to: navigation, search

The messageNicklistAdd function adds one or many users to a chat windows nicklist area.

Compatibility: 2.0 and higher

Contents

Syntax

plugin_send(MYGUID, "messageNicklistAdd", struct nicklist_change_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

MessageNicklistAdd utilitizes the nicklist_change_t structure.

struct nicklist_change_t {  
 	unsigned int			struct_size; 
 
 	int				window_id; 
 	int				connection_id; 
 
 	char				*medium; 
 	char				*location; 
 	 
 	struct nicklist_entry_t*	nicklist; 
 };



connection_id
The connection id of the window.
window_id
The window id of the window. If this is 0, the other variables are used to locate the window.
medium
The medium of the window.
location
The chat window name.
nicklist
A linked list of user entries in nicklist_entry_t structures to add to the nicklist. See below for more information.


Return Value

Negative value on error, 0 on success.

Remarks

Be sure to remove the nick when the plugin is stopped or the user is no longer within the chat session.

Unlike when working with the contact list, adding the same information more than once will create a duplicate entry.


Additional Structures

nicklist_entry_t

struct nicklist_entry_t {  
 	unsigned int			struct_size; 
 
 	char				*name; 
 	char				*group; 
 	char				*tooltip; 
 
 	int				group_score; 
 
 	struct menu_entry_t		*menu; 
 
 	ttkCallback			callback; 
 
 	void				*data; 
 
 	struct nicklist_entry_t*	next_nicklist_entry;	 
 };


name
The name of the user to add.
group
The group to add the user to. Use NULL if you do not wish to have it belong to a group.
tooltip
The tooltip text to associate with this user.
group_score
A numeric representing the priority of the group. This will provide Trillian with a proper way to order the groups. Operators/users with administrative privileges should have a score greater than 10.
menu
A menu to associate with the user.
callback
The callback to use for nicklist notification. For a list of these notifications see the 'Nicklist Notifications' section of the docs.
data
Data to send with the above callback.
next_nicklist_entry
When adding more than one user at a time, supply the next user here. The last user in the list will set this value to NULL.
Personal tools