comparison plugins/autorecon.c @ 99:f810fc7d423f

[gaim-migrate @ 109] Autorecon reconnects you on signoff (kick). Made other small changes. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 09 Apr 2000 20:29:25 +0000
parents
children c09b48f8f7f4
comparison
equal deleted inserted replaced
98:c2d22261e281 99:f810fc7d423f
1 #define GAIM_PLUGINS
2 #include "gaim.h"
3 #include <gtk/gtk.h>
4
5 static int recon;
6
7 char *name() {
8 return "Auto Reconnect";
9 }
10
11 char *description() {
12 return "When AOL kicks you off, this auto-reconnects you.";
13 }
14
15 extern void dologin(GtkWidget *, GtkWidget *);
16
17 void do_signon() {
18 dologin(NULL, NULL);
19 if (query_state() != STATE_OFFLINE) {
20 gtk_timeout_remove(recon);
21 return;
22 }
23 }
24
25 void reconnect(void *m) {
26 recon = gtk_timeout_add(2000, (GtkFunction)do_signon, NULL);
27 }
28
29 void gaim_plugin_init(void *handle) {
30 gaim_signal_connect(handle, event_signoff, reconnect, NULL);
31 }