Mercurial > pidgin
view plugins/SIGNALS @ 112:a57fd3390ee4
[gaim-migrate @ 122]
Fixed the bug where if there is more than one word either being removed or
inserted, remaining checks hold. E.g. if there is a rule that 'm' gets
replaced with 'your roommate' (this is actually is one of my rules), and another
rule is 'u' -> 'you', typing "m u" used to be "your roommate u", but is now
"your roommate you" (don't ask, it's a stupid example, but it has implications).
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Fri, 14 Apr 2000 06:02:26 +0000 |
| parents | c5a1a1b05c26 |
| children | 8c982b7f18d4 |
line wrap: on
line source
enum gaim_event { event_signon = 0, event_signoff, event_im_recv, event_im_send, event_buddy_signon, event_buddy_signoff, }; To add a signal handler, call the fuction gaim_signal_connect with the following arguments: void *, enum gaim_event, void *, void * The first arg is the handle that was passed to gaim_signal_init. You did save it, right? The second arg is hopefully obvious. The third arg is a pointer to a function that takes various args depending on which event you're dealing with. The fourth arg is any data you want to send to your function, as a final argument. To remove a signal handler, call the function gaim_signal_disconnect with the following arguments: void *, enum gaim_event, void * The first arg is the handle that was passed to gaim_signal_init. The second arg is hopefully obvious. The third arg is a pointer to the function you attached. Note that it deletes *all* functions matching the function you pass, not just one. Sorry, that's just the way it works. So here are the args that get passed to your functions in various events: event_signon: (none) Note that you can get the username (which would probably be the only useful information here) from other places. (Read gaim.h for details). event_signoff: (none) event_im_recv: char **who, char **text 'who' is the username of the person who sent the message. 'text' is the actual strict text (with HTML tags and all) of the message they sent. Note that you can modify these values. (You are encouraged to do so!) Note that *other* plugins can also modify these values, so you should check that they are not NULL, and try not to leave them as NULL. event_im_send: char *who, char **text 'who' is the username of the person you're sending the message to. 'text' is the actual strict text (with HTML tags and all) of the message you're sending. Note that you can modify outgoing text. (You are _not_ encouraged to do so ;-) .) event_buddy_signon: char *who 'who' is who signed on. event_buddy_signoff: char *who 'who' is who signed off.
