comparison plugins/autorecon.c @ 4491:3196d9044a45

[gaim-migrate @ 4766] aim_user is dead. long live gaim_account. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 31 Jan 2003 13:03:47 +0000
parents 59751fe608c5
children b5a50a6a13b0
comparison
equal deleted inserted replaced
4490:70b892694e0b 4491:3196d9044a45
17 static GHashTable *hash = NULL; 17 static GHashTable *hash = NULL;
18 18
19 static guint tim = 0; 19 static guint tim = 0;
20 20
21 static gboolean do_signon(gpointer data) { 21 static gboolean do_signon(gpointer data) {
22 struct aim_user *u = data; 22 struct gaim_account *account = data;
23 if (g_slist_index(aim_users, u) < 0) 23 if (g_slist_index(gaim_accounts, account) < 0)
24 return FALSE; 24 return FALSE;
25 serv_login(u); 25 serv_login(account);
26 tim = 0; 26 tim = 0;
27 return FALSE; 27 return FALSE;
28 } 28 }
29 29
30 static void reconnect(struct gaim_connection *gc, void *m) { 30 static void reconnect(struct gaim_connection *gc, void *m) {
31 if (!gc->wants_to_die) { 31 if (!gc->wants_to_die) {
32 int del; 32 int del;
33 del = (int)g_hash_table_lookup(hash, gc->user); 33 del = (int)g_hash_table_lookup(hash, gc->account);
34 if (!del) 34 if (!del)
35 del = INITIAL; 35 del = INITIAL;
36 else 36 else
37 del = MAX(2 * del, MAXTIME); 37 del = MAX(2 * del, MAXTIME);
38 tim = g_timeout_add(del, do_signon, gc->user); 38 tim = g_timeout_add(del, do_signon, gc->account);
39 g_hash_table_insert(hash, gc->user, (gpointer)del); 39 g_hash_table_insert(hash, gc->account, (gpointer)del);
40 } else { 40 } else {
41 g_hash_table_remove(hash, gc->user); 41 g_hash_table_remove(hash, gc->account);
42 } 42 }
43 } 43 }
44 44
45 /* 45 /*
46 * EXPORTED FUNCTIONS 46 * EXPORTED FUNCTIONS