diff src/away.c @ 133:e277d5f0c1dd

[gaim-migrate @ 143] Let's see if I can remember everything I did: - Fixed a bug I let slip. If you choose the new option to not play login sounds when you log in, and then quit before the timeout is up, it would save that you didn't want login sounds at all. - Added two new plugin events: event_away and event_buddy_away. - Made GtkWidget *imaway in away.c and void play(uchar *, int) in sound.c not static any more (though not referenced in gaim.h). This is so plugins can use those (and not have to worry about writing their own sound code). - Wrote a quick plugin to auto-iconify windows when you go away. I had just been locally patching my own copy, since I figured it wasn't worth including as an option. It also demonstrates some of the issues of deciding between USE_APPLET and not. Perhaps plugins are the way to go with some things that would otherwise have been options (for example, the Lag-O-Meter is one of those things that could possibly have been a plugin instead of hard-coded in). I think that's everything. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 19 Apr 2000 02:04:30 +0000
parents 55faf2e3a134
children 4e91b92f91a7
line wrap: on
line diff
--- a/src/away.c	Tue Apr 18 09:05:55 2000 +0000
+++ b/src/away.c	Wed Apr 19 02:04:30 2000 +0000
@@ -32,7 +32,7 @@
 #include <gtk/gtk.h>
 #include "gaim.h"
 
-static GtkWidget *imaway=NULL;
+GtkWidget *imaway=NULL;
 #ifdef USE_APPLET
 extern enum gaim_user_states MRI_user_status;
 #endif
@@ -165,6 +165,21 @@
         serv_set_away(buf2);
         g_free(buf2);
 	gtk_widget_show(imaway);
+#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_away && g->function != NULL) { 
+				function = g->function;
+				(*function)(g->data);
+			}
+			c = c->next;
+		}
+	}
+#endif
 }
 
 void rem_away_mess(GtkWidget *w, struct away_message *a)