diff src/buddy.c @ 94:9f6ce50ffb78

[gaim-migrate @ 104] Woohoo, the landing of the plugins. Nearly everything necessary is here. The only thing missing is that you can't load a plugin without signing on first (at least, not without some trickery). committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 09 Apr 2000 11:18:25 +0000
parents f5b305c0d974
children 55faf2e3a134
line wrap: on
line diff
--- a/src/buddy.c	Sun Apr 09 08:25:15 2000 +0000
+++ b/src/buddy.c	Sun Apr 09 11:18:25 2000 +0000
@@ -304,6 +304,21 @@
 void signoff()
 {
 	GList *mem;
+
+#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_signoff && g->function != NULL) {
+			function = g->function;
+			(*function)(g->data);
+		}
+		c = c->next;
+	}
+#endif
+
         while(groups) {
 		mem = ((struct group *)groups->data)->members;
 		while(mem) {
@@ -1359,6 +1374,20 @@
                 
 
                 if (!GTK_WIDGET_VISIBLE(b->item)) {
+#ifdef GAIM_PLUGINS
+			GList *c = callbacks;
+			struct gaim_callback *g;
+			void (*function)(char *, void *);
+			while (c) {
+				g = (struct gaim_callback *)c->data;
+				if (g->event == event_buddy_signon &&
+						g->function != NULL) {
+					function = g->function;
+					(*function)(b->name, g->data);
+				}
+				c = c->next;
+			}
+#endif
 			
 			play_sound(BUDDY_ARRIVE);
 
@@ -1437,6 +1466,20 @@
 
 	} else {
 		if (GTK_WIDGET_VISIBLE(b->item)) {
+#ifdef GAIM_PLUGINS
+			GList *c = callbacks;
+			struct gaim_callback *g;
+			void (*function)(char *, void *);
+			while (c) {
+				g = (struct gaim_callback *)c->data;
+				if (g->event == event_buddy_signoff &&
+						g->function != NULL) {
+					function = g->function;
+					(*function)(b->name, g->data);
+				}
+				c = c->next;
+			}
+#endif
 			play_sound(BUDDY_LEAVE);
 			pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
 				NULL, (gchar **)logout_icon_xpm);