changeset 136:4e91b92f91a7

[gaim-migrate @ 146] Added event_back and event_buddy_back events. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 19 Apr 2000 07:57:20 +0000
parents e9852a08f9c6
children fe81c8b4951d
files plugins/SIGNALS src/away.c src/gaim.h src/server.c
diffstat 4 files changed, 49 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)
 	
--- 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;
--- 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"
--- 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;