Mercurial > pidgin
diff plugins/iconaway.c @ 6485:70d5122bc3ff
[gaim-migrate @ 6999]
Removed the old event system and replaced it with a much better signal
system. There will most likely be some bugs in this, but it seems to be
working for now. Plugins can now generate their own signals, and other
plugins can find those plugins and connect to them. This could give
plugins a form of IPC. It's also useful for other things. It's rather
flexible, except for the damn marshalling, but there's no way around that
that I or the glib people can see.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 18 Aug 2003 01:03:43 +0000 |
parents | 8f94cce8faa5 |
children | bf630f7dfdcd |
line wrap: on
line diff
--- a/plugins/iconaway.c Sun Aug 17 17:55:46 2003 +0000 +++ b/plugins/iconaway.c Mon Aug 18 01:03:43 2003 +0000 @@ -1,6 +1,7 @@ #include "gtkinternal.h" #include "conversation.h" +#include "signals.h" #include "gtkconv.h" #include "gtkplugin.h" @@ -17,10 +18,14 @@ extern void applet_destroy_buddy(); #endif -void iconify_windows(GaimConnection *gc, char *state, - char *message, void *data) { +static void +iconify_windows(GaimAccount *account, char *state, char *message, void *data) +{ GaimWindow *win; GList *windows; + GaimConnection *gc; + + gc = gaim_account_get_connection(account); if (!imaway || !gc->away) return; @@ -51,7 +56,8 @@ static gboolean plugin_load(GaimPlugin *plugin) { - gaim_signal_connect(plugin, event_away, iconify_windows, NULL); + gaim_signal_connect(gaim_accounts_get_handle(), "account-away", + plugin, GAIM_CALLBACK(iconify_windows), NULL); return TRUE; } @@ -78,7 +84,7 @@ /** description */ N_("Iconifies the buddy list and your conversations when you go away."), "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */ - GAIM_WEBSITE, /**< homepage */ + GAIM_WEBSITE, /**< homepage */ plugin_load, /**< load */ NULL, /**< unload */