# HG changeset patch # User Eric Warmenhoven # Date 956131040 0 # Node ID 4e91b92f91a7cc56399930a762b1dd71cac38f87 # Parent e9852a08f9c61ef3cd8e14a498e9d5961fce8689 [gaim-migrate @ 146] Added event_back and event_buddy_back events. committer: Tailor Script diff -r e9852a08f9c6 -r 4e91b92f91a7 plugins/SIGNALS --- a/plugins/SIGNALS Wed Apr 19 02:48:47 2000 +0000 +++ b/plugins/SIGNALS Wed Apr 19 07:57:20 2000 +0000 @@ -2,11 +2,13 @@ event_signon = 0, event_signoff, event_away, + event_back, event_im_recv, event_im_send, event_buddy_signon, event_buddy_signoff, event_buddy_away, + event_buddy_back, event_blist_update }; @@ -41,7 +43,7 @@ (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). + useful information here) from other places. (Read gaim.h for details.) event_signoff: (none) @@ -49,6 +51,12 @@ event_away: (none) + Note that the away message that's being used can be retrieved from a + global variable. (Read gaim.h for details.) + +event_back: + (none) + event_im_recv: char **who, char **text @@ -85,6 +93,11 @@ 'who' is who went away. +event_buddy_back: + char *who + + 'who' is who is no longer away. + event_blist_update: (none) diff -r e9852a08f9c6 -r 4e91b92f91a7 src/away.c --- a/src/away.c Wed Apr 19 02:48:47 2000 +0000 +++ b/src/away.c Wed Apr 19 07:57:20 2000 +0000 @@ -69,12 +69,27 @@ serv_set_away(NULL); awaymessage = NULL; +#ifdef GAIM_PLUGINS + { + GList *c = callbacks; + struct gaim_callback *g; + void (*function)(void *); + while (c) { + g = (struct gaim_callback *)c->data; + if (g->event == event_back && g->function != NULL) { + function = g->function; + (*function)(g->data); + } + c = c->next; + } + } +#endif } void do_away_message(GtkWidget *w, struct away_message *a) { GtkWidget *back; - GtkWidget *awaytext; + GtkWidget *awaytext; GtkWidget *vscrollbar; GtkWidget *bbox; GtkWidget *vbox; diff -r e9852a08f9c6 -r 4e91b92f91a7 src/gaim.h --- a/src/gaim.h Wed Apr 19 02:48:47 2000 +0000 +++ b/src/gaim.h Wed Apr 19 07:57:20 2000 +0000 @@ -132,11 +132,13 @@ event_signon = 0, event_signoff, event_away, + event_back, event_im_recv, event_im_send, event_buddy_signon, event_buddy_signoff, event_buddy_away, + event_buddy_back, event_blist_update, /* any others? it's easy to add... */ }; @@ -293,7 +295,7 @@ #define TYPE_SIGNOFF 4 #define TYPE_KEEPALIVE 5 -#define REVISION "gaim:$Revision: 143 $" +#define REVISION "gaim:$Revision: 146 $" #define FLAPON "FLAPON\r\n\r\n" #define ROAST "Tic/Toc" diff -r e9852a08f9c6 -r 4e91b92f91a7 src/server.c --- a/src/server.c Wed Apr 19 02:48:47 2000 +0000 +++ b/src/server.c Wed Apr 19 07:57:20 2000 +0000 @@ -628,6 +628,22 @@ b->idle = idle; b->evil = evil; +#ifdef GAIM_PLUGINS + if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) { + GList *c = callbacks; + struct gaim_callback *g; + void (*function)(char *, void *); + while (c) { + g = (struct gaim_callback *)c->data; + if (g->event == event_buddy_back && + g->function != NULL) { + function = g->function; + (*function)(b->name, g->data); + } + c = c->next; + } + } +#endif b->uc = type; b->signon = signon;