view plugins/autorecon.c @ 119:66ec3865bd46

[gaim-migrate @ 129] When you have more than 1 group, one group displays below another. When someone from the top group signs out, the people in that group move up, but the groups below don't move up. Now they do. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 15 Apr 2000 21:25:22 +0000
parents f810fc7d423f
children c09b48f8f7f4
line wrap: on
line source

#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);
}