# HG changeset patch # User Eric Warmenhoven # Date 955312165 0 # Node ID f810fc7d423fec76dde9195e3d89b665048c5a07 # Parent c2d22261e281de47d3b89ed2953e116519bab998 [gaim-migrate @ 109] Autorecon reconnects you on signoff (kick). Made other small changes. committer: Tailor Script diff -r c2d22261e281 -r f810fc7d423f plugins/Makefile --- a/plugins/Makefile Sun Apr 09 20:16:40 2000 +0000 +++ b/plugins/Makefile Sun Apr 09 20:29:25 2000 +0000 @@ -2,7 +2,7 @@ CFLAGS = -Wall `gnome-config --cflags gtk` -I../src LDFLAGS = -ggdb `gnome-config --libs gtk` -shared -all: simple.so gaiminc.so file_control.so +all: simple.so gaiminc.so autorecon.so .SUFFIXES: .c .so diff -r c2d22261e281 -r f810fc7d423f plugins/autorecon.c --- /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 + +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); +} diff -r c2d22261e281 -r f810fc7d423f plugins/gaiminc.c --- a/plugins/gaiminc.c Sun Apr 09 20:16:40 2000 +0000 +++ b/plugins/gaiminc.c Sun Apr 09 20:29:25 2000 +0000 @@ -17,6 +17,11 @@ * the text of the message (HTML and all) will be reversed. */ int i, l; char tmp; + + /* this check is necessary in case bad plugins do bad things */ + if (message == NULL || *message == NULL) + return; + l = strlen(*message); if (!strcmp(*who, current_user->username))