99
|
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 }
|