plugins/autorecon.c

Fri, 14 Apr 2000 06:02:26 +0000

author
Eric Warmenhoven <warmenhoven@yahoo.com>
date
Fri, 14 Apr 2000 06:02:26 +0000
changeset 112
232fe3aea76f
parent 99
eed3f8358586
child 148
472f0f9c9799
permissions
-rw-r--r--

[gaim-migrate @ 122]
Fixed the bug where if there is more than one word either being removed or
inserted, remaining checks hold. E.g. if there is a rule that 'm' gets
replaced with 'your roommate' (this is actually is one of my rules), and another
rule is 'u' -> 'you', typing "m u" used to be "your roommate u", but is now
"your roommate you" (don't ask, it's a stupid example, but it has implications).

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

mercurial