MessageMorph

From TrillWiki

Jump to: navigation, search

The messageMorph function allows an existing message window to morph looks into another. One reason you may wish this to happen is if a private chat turns into a group chat. The window would then start out as a private chat, and then change to the group chat with a nicklist and other options available.

Compatibility: 2.0 and higher

Contents

Syntax

plugin_send(MYGUID, "messageMorph", struct message_morph_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

MessageMorph utilitizes the message_morph_t structure.

struct message_morph_t {  
 	unsigned int				struct_size; 
 
 	struct message_t			*original_window; 
 	struct message_t			*new_window; 
 };



original_window
The message_t struct filled to locate the original window. Fill this structure similar to a messageSend in order to locate the window.
new_window
The new window options to use for the morphed window. For more information on how to fill this structure, look at the messageOpen function.


Return Value

Negative value on error, new window id on success. A return value of '-4' means that there was nothing to change.

Remarks

The use of this function (instead of just simply destroying the window and recreating) is that it will keep the contents of the window, it will appear in the same container/location and will not dramatically change from the user's perspective.

Note that the window id for the window will change, so be sure to note the new id returned from the function.


Personal tools