diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/autorecon.c	Sun Apr 09 20:29:25 2000 +0000
@@ -0,0 +1,31 @@
+#define GAIM_PLUGINS
+#include "gaim.h"
+#include <gtk/gtk.h>
+
+static int recon;
+
+char *name() {
+	return "Auto Reconnect";
+}
+
+char *description() {
+	return "When AOL kicks you off, this auto-reconnects you.";
+}
+
+extern void dologin(GtkWidget *, GtkWidget *);
+
+void do_signon() {
+	dologin(NULL, NULL);
+	if (query_state() != STATE_OFFLINE) {
+		gtk_timeout_remove(recon);
+		return;
+	}
+}
+
+void reconnect(void *m) {
+	recon = gtk_timeout_add(2000, (GtkFunction)do_signon, NULL);
+}
+
+void gaim_plugin_init(void *handle) {
+	gaim_signal_connect(handle, event_signoff, reconnect, NULL);
+}