comparison plugins/autorecon.c @ 3630:9682c0e022c6

[gaim-migrate @ 3753] Yeah this will probably break a lot of shit knowing my luck. But hey, I really don't care what people thnk. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 11 Oct 2002 03:14:01 +0000
parents 837f8ff999be
children 9bcb42faccc0
comparison
equal deleted inserted replaced
3629:afc5bb164c5a 3630:9682c0e022c6
1 #define GAIM_PLUGINS 1 #define GAIM_PLUGINS
2 #include "gaim.h" 2 #include "gaim.h"
3 #include "prpl.h" 3 #include "prpl.h"
4
5 #ifdef _WIN32
6 #include "win32dep.h"
7 #endif
4 8
5 #define INITIAL 8000 9 #define INITIAL 8000
6 #define MAXTIME 1024000 10 #define MAXTIME 1024000
7 11
8 static GHashTable *hash = NULL; 12 static GHashTable *hash = NULL;
9 13
10 static guint tim = 0; 14 static guint tim = 0;
11
12 char *name() {
13 return "Auto Reconnect";
14 }
15
16 char *description() {
17 return "When you are kicked offline, this reconnects you.";
18 }
19 15
20 static gboolean do_signon(gpointer data) { 16 static gboolean do_signon(gpointer data) {
21 struct aim_user *u = data; 17 struct aim_user *u = data;
22 if (g_slist_index(aim_users, u) < 0) 18 if (g_slist_index(aim_users, u) < 0)
23 return FALSE; 19 return FALSE;
39 } else { 35 } else {
40 g_hash_table_remove(hash, gc->user); 36 g_hash_table_remove(hash, gc->user);
41 } 37 }
42 } 38 }
43 39
44 char *gaim_plugin_init(GModule *handle) { 40 /*
41 * EXPORTED FUNCTIONS
42 */
43
44 G_MODULE_EXPORT char *name() {
45 return "Auto Reconnect";
46 }
47
48 G_MODULE_EXPORT char *description() {
49 return "When you are kicked offline, this reconnects you.";
50 }
51
52 G_MODULE_EXPORT char *gaim_plugin_init(GModule *handle) {
45 hash = g_hash_table_new(g_int_hash, g_int_equal); 53 hash = g_hash_table_new(g_int_hash, g_int_equal);
46 54
47 gaim_signal_connect(handle, event_signoff, reconnect, NULL); 55 gaim_signal_connect(handle, event_signoff, reconnect, NULL);
48 56
49 return NULL; 57 return NULL;
50 } 58 }
51 59
52 void gaim_plugin_remove() { 60 G_MODULE_EXPORT void gaim_plugin_remove() {
53 if (tim) 61 if (tim)
54 g_source_remove(tim); 62 g_source_remove(tim);
55 g_hash_table_destroy(hash); 63 g_hash_table_destroy(hash);
56 hash = NULL; 64 hash = NULL;
57 tim = 0; 65 tim = 0;