Mercurial > pidgin
view plugins/autorecon.c @ 2393:a7ecfd3f7714
[gaim-migrate @ 2406]
Arkadiusz Miskiewicz\'s Gadu-Gadu plugin. I was able to figure out enough polish to be able to download Gadu-Gadu, create an account, and test the plugin. Imagine my shock when I got my info and it said I was a woman. Whoops.
Also splitting plugins.c so that non-gtk stuff is in modules.c. gaim-core is almost ready for protocol implantaion.
Also fixing an IRC bug.
Also patiently waiting for anoncvs_gaim's lock in /cvsroot/gaim/gaim/pixmaps
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 29 Sep 2001 23:06:30 +0000 |
parents | f7f5a23b6f76 |
children | 837f8ff999be |
line wrap: on
line source
#define GAIM_PLUGINS #include "gaim.h" #include "prpl.h" #define INITIAL 8000 #define MAXTIME 1024000 static GHashTable *hash = NULL; static guint tim = 0; char *name() { return "Auto Reconnect"; } char *description() { return "When you are kicked offline, this reconnects you."; } static gboolean do_signon(gpointer data) { struct aim_user *u = data; if (g_list_index(aim_users, u) < 0) return FALSE; serv_login(u); tim = 0; return FALSE; } static void reconnect(struct gaim_connection *gc, void *m) { if (!gc->wants_to_die) { int del; del = (int)g_hash_table_lookup(hash, gc->user); if (!del) del = INITIAL; else del = MAX(2 * del, MAXTIME); tim = g_timeout_add(del, do_signon, gc->user); g_hash_table_insert(hash, gc->user, (gpointer)del); } else { g_hash_table_remove(hash, gc->user); } } char *gaim_plugin_init(GModule *handle) { hash = g_hash_table_new(g_int_hash, g_int_equal); gaim_signal_connect(handle, event_signoff, reconnect, NULL); return NULL; } void gaim_plugin_remove() { if (tim) g_source_remove(tim); g_hash_table_destroy(hash); hash = NULL; tim = 0; }