view plugins/autorecon.c @ 2133:8dec90cbffb7

[gaim-migrate @ 2143] whoops. thanks Toomas Gavrilin. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 08 Aug 2001 16:32:41 +0000
parents 84782d1cb051
children 66783ad29e55
line wrap: on
line source

#define GAIM_PLUGINS
#include "gaim.h"
#include "prpl.h"
#include <gtk/gtk.h>

char *name() {
	return "Auto Reconnect";
}

char *description() {
	return "When you are kicked offline, this reconnects you.";
}

static gboolean do_signon(struct aim_user *u) {
	if (g_list_index(aim_users, u) < 0)
		return FALSE;
	serv_login(u);
	return FALSE;
}

static void reconnect(struct gaim_connection *gc, void *m) {
	if (!gc->wants_to_die)
		gtk_timeout_add(8000, (GtkFunction)do_signon, gc->user);
}

char *gaim_plugin_init(GModule *handle) {
	gaim_signal_connect(handle, event_signoff, reconnect, NULL);

	return NULL;
}