Mercurial > pidgin.yaz
comparison plugins/mailchk.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 | cce494e69d68 |
comparison
equal
deleted
inserted
replaced
6484:5ced8e111473 | 6485:70d5122bc3ff |
---|---|
111 | 111 |
112 static gboolean | 112 static gboolean |
113 plugin_load(GaimPlugin *plugin) | 113 plugin_load(GaimPlugin *plugin) |
114 { | 114 { |
115 struct gaim_buddy_list *list = gaim_get_blist(); | 115 struct gaim_buddy_list *list = gaim_get_blist(); |
116 void *conn_handle = gaim_connections_get_handle(); | |
117 | |
116 if (!check_timeout(NULL)) { | 118 if (!check_timeout(NULL)) { |
117 gaim_debug(GAIM_DEBUG_WARNING, "mailchk", "Could not read $MAIL or /var/spool/mail/$USER"); | 119 gaim_debug(GAIM_DEBUG_WARNING, "mailchk", "Could not read $MAIL or /var/spool/mail/$USER"); |
118 return FALSE; | 120 return FALSE; |
119 } | 121 } |
120 | 122 |
121 if (list && GAIM_IS_GTK_BLIST(list) && GAIM_GTK_BLIST(list)->vbox) | 123 if (list && GAIM_IS_GTK_BLIST(list) && GAIM_GTK_BLIST(list)->vbox) |
122 timer = g_timeout_add(2000, check_timeout, NULL); | 124 timer = g_timeout_add(2000, check_timeout, NULL); |
123 | 125 |
124 gaim_signal_connect(plugin, event_signon, signon_cb, NULL); | 126 gaim_signal_connect(conn_handle, "signed-on", |
125 gaim_signal_connect(plugin, event_signoff, signoff_cb, NULL); | 127 plugin, GAIM_CALLBACK(signon_cb), NULL); |
128 gaim_signal_connect(conn_handle, "signed-off", | |
129 plugin, GAIM_CALLBACK(signoff_cb), NULL); | |
126 | 130 |
127 return TRUE; | 131 return TRUE; |
128 } | 132 } |
129 | 133 |
130 static gboolean | 134 static gboolean |