annotate plugins/autorecon.c @ 110:f7c6366ca703

[gaim-migrate @ 120] Okay, this is cool. Plugins are now configurable. They can each do whatever whenever someone clicks a little "Configure Plugin" button. This is optional; plugins don't have to be configurable, and if they're not, the button isn't clickable. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 12 Apr 2000 22:18:15 +0000
parents f810fc7d423f
children c09b48f8f7f4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
99
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 #define GAIM_PLUGINS
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 #include "gaim.h"
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 #include <gtk/gtk.h>
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 static int recon;
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 char *name() {
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 return "Auto Reconnect";
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 }
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 char *description() {
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 return "When AOL kicks you off, this auto-reconnects you.";
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 }
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 extern void dologin(GtkWidget *, GtkWidget *);
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 void do_signon() {
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18 dologin(NULL, NULL);
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 if (query_state() != STATE_OFFLINE) {
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20 gtk_timeout_remove(recon);
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 return;
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 }
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 }
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 void reconnect(void *m) {
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 recon = gtk_timeout_add(2000, (GtkFunction)do_signon, NULL);
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 }
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 void gaim_plugin_init(void *handle) {
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 gaim_signal_connect(handle, event_signoff, reconnect, NULL);
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 }