| 46 } else { |
50 } else { |
| 47 g_hash_table_remove(hash, gc->account); |
51 g_hash_table_remove(hash, gc->account); |
| 48 } |
52 } |
| 49 } |
53 } |
| 50 |
54 |
| 51 /* |
55 static gboolean |
| 52 * EXPORTED FUNCTIONS |
56 plugin_load(GaimPlugin *plugin) |
| 53 */ |
57 { |
| |
58 hash = g_hash_table_new(g_int_hash, g_int_equal); |
| 54 |
59 |
| 55 struct gaim_plugin_description desc; |
60 gaim_signal_connect(plugin, event_signoff, reconnect, NULL); |
| 56 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() { |
61 |
| 57 desc.api_version = PLUGIN_API_VERSION; |
62 return TRUE; |
| 58 desc.name = g_strdup(_("Autoreconnect")); |
|
| 59 desc.version = g_strdup(VERSION); |
|
| 60 desc.description = g_strdup(_("When you are kicked offline, this reconnects you.")); |
|
| 61 desc.authors = g_strdup("Eric Warmenhoven <eric@warmenhoven.org>"); |
|
| 62 desc.url = g_strdup(WEBSITE); |
|
| 63 return &desc; |
|
| 64 } |
63 } |
| 65 |
64 |
| 66 G_MODULE_EXPORT char *name() { |
65 static gboolean |
| 67 return _("Auto Reconnect"); |
66 plugin_unload(GaimPlugin *plugin) |
| |
67 { |
| |
68 if (tim) |
| |
69 g_source_remove(tim); |
| |
70 |
| |
71 gaim_signal_disconnect(plugin, event_signoff, reconnect); |
| |
72 |
| |
73 g_hash_table_destroy(hash); |
| |
74 |
| |
75 hash = NULL; |
| |
76 tim = 0; |
| |
77 |
| |
78 return TRUE; |
| 68 } |
79 } |
| 69 |
80 |
| 70 G_MODULE_EXPORT char *description() { |
81 static GaimPluginInfo info = |
| 71 return _("When you are kicked offline, this reconnects you."); |
82 { |
| |
83 2, /**< api_version */ |
| |
84 GAIM_PLUGIN_STANDARD, /**< type */ |
| |
85 NULL, /**< ui_requirement */ |
| |
86 0, /**< flags */ |
| |
87 NULL, /**< dependencies */ |
| |
88 GAIM_PRIORITY_DEFAULT, /**< priority */ |
| |
89 |
| |
90 AUTORECON_PLUGIN_ID, /**< id */ |
| |
91 N_("Auto-Reconnect"), /**< name */ |
| |
92 VERSION, /**< version */ |
| |
93 /** summary */ |
| |
94 N_("When you are kicked offline, this reconnects you."), |
| |
95 /** description */ |
| |
96 N_("When you are kicked offline, this reconnects you."), |
| |
97 "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */ |
| |
98 WEBSITE, /**< homepage */ |
| |
99 |
| |
100 plugin_load, /**< load */ |
| |
101 plugin_unload, /**< unload */ |
| |
102 NULL, /**< destroy */ |
| |
103 |
| |
104 NULL, /**< ui_info */ |
| |
105 NULL /**< extra_info */ |
| |
106 }; |
| |
107 |
| |
108 static void |
| |
109 __init_plugin(GaimPlugin *plugin) |
| |
110 { |
| 72 } |
111 } |
| 73 |
112 |
| 74 G_MODULE_EXPORT char *gaim_plugin_init(GModule *handle) { |
113 GAIM_INIT_PLUGIN(autorecon, __init_plugin, info); |
| 75 hash = g_hash_table_new(g_int_hash, g_int_equal); |
|
| 76 |
|
| 77 gaim_signal_connect(handle, event_signoff, reconnect, NULL); |
|
| 78 |
|
| 79 return NULL; |
|
| 80 } |
|
| 81 |
|
| 82 G_MODULE_EXPORT void gaim_plugin_remove() { |
|
| 83 if (tim) |
|
| 84 g_source_remove(tim); |
|
| 85 g_hash_table_destroy(hash); |
|
| 86 hash = NULL; |
|
| 87 tim = 0; |
|
| 88 } |
|