annotate plugins/autorecon.c @ 9920:a58f010171f9

[gaim-migrate @ 10812] i decided this was a more or less valid request committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 31 Aug 2004 15:50:46 +0000
parents 14c1ffd053e5
children 24550263874d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5607
diff changeset
1 #include "internal.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5607
diff changeset
2
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5607
diff changeset
3 #include "connection.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5607
diff changeset
4 #include "debug.h"
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
5 #include "pluginpref.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5607
diff changeset
6 #include "prpl.h"
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
7 #include "signals.h"
4202
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4113
diff changeset
8
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
9
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
10 #define AUTORECON_PLUGIN_ID "core-autorecon"
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
11
2216
66783ad29e55 [gaim-migrate @ 2226]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1818
diff changeset
12 #define INITIAL 8000
4590
3b8e6c2b4a50 [gaim-migrate @ 4874]
Luke Schierer <lschiere@pidgin.im>
parents: 4585
diff changeset
13 #define MAXTIME 2048000
2216
66783ad29e55 [gaim-migrate @ 2226]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1818
diff changeset
14
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
15 typedef struct {
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
16 int delay;
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
17 guint timeout;
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
18 } GaimAutoRecon;
2216
66783ad29e55 [gaim-migrate @ 2226]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1818
diff changeset
19
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
20 /*
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
21 I use a struct here, but the visible/invisible isn't yet supported
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
22 in this plugin, so this is more for future implementation of those
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
23 features
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
24 */
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
25 typedef struct {
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
26 const char *state;
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
27 const char *message;
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
28 } GaimAwayState;
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
29
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
30 static GHashTable *hash = NULL;
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
31 static GHashTable *awayStates = NULL;
99
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
33
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
34 #define AUTORECON_OPT "/plugins/core/autorecon"
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
35 #define OPT_HIDE_CONNECTED AUTORECON_OPT "/hide_connected_error"
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
36 #define OPT_HIDE_CONNECTING AUTORECON_OPT "/hide_connecting_error"
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
37 #define OPT_RESTORE_STATE AUTORECON_OPT "/restore_state"
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
38
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
39
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
40 /* storage of original (old_ops) and modified (new_ops) ui ops to allow us to
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
41 intercept calls to report_disconnect */
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
42 static GaimConnectionUiOps *old_ops = NULL;
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
43 static GaimConnectionUiOps *new_ops = NULL;
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
44
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
45
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
46 static void report_disconnect(GaimConnection *gc, const char *text) {
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
47
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
48 if(old_ops == NULL || old_ops->report_disconnect == NULL) {
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
49 /* there's nothing to call through to, so don't bother
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
50 checking prefs */
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
51 return;
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
52
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
53 } else if(gc->state == GAIM_CONNECTED
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
54 && gaim_prefs_get_bool(OPT_HIDE_CONNECTED)) {
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
55 /* this is a connected error, and we're hiding those */
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
56 gaim_debug(GAIM_DEBUG_INFO, "autorecon",
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
57 "hid disconnect error message\n");
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
58 return;
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
59
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
60 } else if(gc->state == GAIM_CONNECTING
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
61 && gaim_prefs_get_bool(OPT_HIDE_CONNECTING)) {
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
62 /* this is a connecting error, and we're hiding those */
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
63 gaim_debug(GAIM_DEBUG_INFO, "autorecon",
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
64 "hid error message while connecting\n");
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
65 return;
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
66 }
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
67
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
68 /* if we haven't returned by now, then let's pass to the real
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
69 function */
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
70 old_ops->report_disconnect(gc, text);
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
71 }
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
72
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
73
2216
66783ad29e55 [gaim-migrate @ 2226]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1818
diff changeset
74 static gboolean do_signon(gpointer data) {
5587
1c55b1540e18 [gaim-migrate @ 5991]
Christian Hammond <chipx86@chipx86.com>
parents: 5227
diff changeset
75 GaimAccount *account = data;
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
76 GaimAutoRecon *info;
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
77
5227
6d1707dc8c3d [gaim-migrate @ 5597]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
78 gaim_debug(GAIM_DEBUG_INFO, "autorecon", "do_signon called\n");
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
79 g_return_val_if_fail(account != NULL, FALSE);
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
80 info = g_hash_table_lookup(hash, account);
4494
b5a50a6a13b0 [gaim-migrate @ 4769]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4491
diff changeset
81
5607
eeba9205dd0f [gaim-migrate @ 6011]
Nathan Walp <nwalp@pidgin.im>
parents: 5587
diff changeset
82 if (g_list_index(gaim_accounts_get_all(), account) < 0)
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
83 return FALSE;
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
84
7372
4ce6952d7908 [gaim-migrate @ 7967]
Nathan Walp <nwalp@pidgin.im>
parents: 7112
diff changeset
85 if(info)
4ce6952d7908 [gaim-migrate @ 7967]
Nathan Walp <nwalp@pidgin.im>
parents: 7112
diff changeset
86 info->timeout = 0;
4ce6952d7908 [gaim-migrate @ 7967]
Nathan Walp <nwalp@pidgin.im>
parents: 7112
diff changeset
87
5587
1c55b1540e18 [gaim-migrate @ 5991]
Christian Hammond <chipx86@chipx86.com>
parents: 5227
diff changeset
88 gaim_debug(GAIM_DEBUG_INFO, "autorecon", "calling gaim_account_connect\n");
1c55b1540e18 [gaim-migrate @ 5991]
Christian Hammond <chipx86@chipx86.com>
parents: 5227
diff changeset
89 gaim_account_connect(account);
1c55b1540e18 [gaim-migrate @ 5991]
Christian Hammond <chipx86@chipx86.com>
parents: 5227
diff changeset
90 gaim_debug(GAIM_DEBUG_INFO, "autorecon", "done calling gaim_account_connect\n");
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
91
1817
b367beee6448 [gaim-migrate @ 1827]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
92 return FALSE;
1378
aedeb1218a0a [gaim-migrate @ 1388]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1165
diff changeset
93 }
aedeb1218a0a [gaim-migrate @ 1388]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1165
diff changeset
94
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
95
5587
1c55b1540e18 [gaim-migrate @ 5991]
Christian Hammond <chipx86@chipx86.com>
parents: 5227
diff changeset
96 static void reconnect(GaimConnection *gc, void *m) {
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
97 GaimAccount *account;
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
98 GaimAutoRecon *info;
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
99
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
100 g_return_if_fail(gc != NULL);
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
101 account = gaim_connection_get_account(gc);
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
102 info = g_hash_table_lookup(hash, account);
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
103
2216
66783ad29e55 [gaim-migrate @ 2226]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1818
diff changeset
104 if (!gc->wants_to_die) {
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
105 if (info == NULL) {
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
106 info = g_new0(GaimAutoRecon, 1);
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
107 g_hash_table_insert(hash, account, info);
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
108 info->delay = INITIAL;
8249
b51ed4506180 [gaim-migrate @ 8972]
Mark Doliner <mark@kingant.net>
parents: 8246
diff changeset
109 } else {
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
110 info->delay = MIN(2 * info->delay, MAXTIME);
8250
b248c1f4efbd [gaim-migrate @ 8973]
Mark Doliner <mark@kingant.net>
parents: 8249
diff changeset
111 if (info->timeout != 0)
b248c1f4efbd [gaim-migrate @ 8973]
Mark Doliner <mark@kingant.net>
parents: 8249
diff changeset
112 g_source_remove(info->timeout);
8249
b51ed4506180 [gaim-migrate @ 8972]
Mark Doliner <mark@kingant.net>
parents: 8246
diff changeset
113 }
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
114 info->timeout = g_timeout_add(info->delay, do_signon, account);
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
115 } else if (info != NULL) {
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
116 g_hash_table_remove(hash, account);
2216
66783ad29e55 [gaim-migrate @ 2226]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1818
diff changeset
117 }
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
118
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
119 if (gc->wants_to_die)
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
120 g_hash_table_remove(awayStates, account);
99
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121 }
f810fc7d423f [gaim-migrate @ 109]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
123 static void save_state(GaimAccount *account, const char *state, const char *message) {
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
124 /* Saves whether the account is back/away/visible/invisible */
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
125
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
126 GaimAwayState *info;
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
127
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
128 if (!strcmp(state,GAIM_AWAY_CUSTOM)) {
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
129 info = g_new0(GaimAwayState, 1);
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
130 info->state = state;
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
131 info->message = message;
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
132
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
133 g_hash_table_insert(awayStates, account, info);
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
134 } else if(!strcmp(state,"Back"))
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
135 g_hash_table_remove(awayStates, account);
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
136 }
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
137
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
138 static void restore_state(GaimConnection *gc, void *m) {
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
139 /* Restore the state to what it was before the disconnect */
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
140 GaimAwayState *info;
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
141 GaimAccount *account;
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
142
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
143 g_return_if_fail(gc != NULL && gaim_prefs_get_bool(OPT_RESTORE_STATE));
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
144 account = gaim_connection_get_account(gc);
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
145
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
146 info = g_hash_table_lookup(awayStates, account);
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
147 if (info)
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
148 serv_set_away(gc, info->state, info->message);
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
149 }
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
150
6113
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
151 static void
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
152 free_auto_recon(gpointer data)
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
153 {
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
154 GaimAutoRecon *info = data;
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
155
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
156 if (info->timeout != 0)
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
157 g_source_remove(info->timeout);
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
158
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
159 g_free(info);
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
160 }
30d4c432101c [gaim-migrate @ 6575]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
161
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
162
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
163 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
164 plugin_load(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
165 {
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
166
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
167 /* this was the suggested way to override a single function of the
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
168 real ui ops. However, there's a mild concern of having more than one
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
169 bit of code making a new ui op call-through copy. If plugins A and B
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
170 both override the ui ops (in that order), B thinks that the
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
171 overridden ui ops A created was the original. If A unloads first,
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
172 and swaps out and frees its overridden version, then B is calling
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
173 through to a free'd ui op. There needs to be a way to "stack up"
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
174 overridden ui ops or something... I have a good idea of how to write
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
175 such a creature if someone wants it done. - siege 2004-04-20 */
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
176
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
177 /* get old ops, make a copy with a minor change */
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
178 old_ops = gaim_connections_get_ui_ops();
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
179 new_ops = (GaimConnectionUiOps *) g_memdup(old_ops,
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
180 sizeof(GaimConnectionUiOps));
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
181 new_ops->report_disconnect = report_disconnect;
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
182 gaim_connections_set_ui_ops(new_ops);
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
183
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
184 hash = g_hash_table_new_full(g_int_hash, g_int_equal, NULL,
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
185 free_auto_recon);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 2398
diff changeset
186
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
187 awayStates = g_hash_table_new(g_int_hash, g_int_equal);
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
188
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
189 gaim_signal_connect(gaim_connections_get_handle(), "signed-off",
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
190 plugin, GAIM_CALLBACK(reconnect), NULL);
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
191
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
192 gaim_signal_connect(gaim_connections_get_handle(), "signed-on",
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
193 plugin, GAIM_CALLBACK(restore_state), NULL);
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
194
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
195 gaim_signal_connect(gaim_accounts_get_handle(), "account-away",
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
196 plugin, GAIM_CALLBACK(save_state), NULL);
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
197
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
198
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
199 return TRUE;
3802
9bcb42faccc0 [gaim-migrate @ 3945]
Sean Egan <seanegan@gmail.com>
parents: 3630
diff changeset
200 }
9bcb42faccc0 [gaim-migrate @ 3945]
Sean Egan <seanegan@gmail.com>
parents: 3630
diff changeset
201
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
202
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
203 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
204 plugin_unload(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
205 {
8243
217643616a74 [gaim-migrate @ 8966]
Luke Schierer <lschiere@pidgin.im>
parents: 7372
diff changeset
206 gaim_signal_disconnect(gaim_connections_get_handle(), "signed-off",
217643616a74 [gaim-migrate @ 8966]
Luke Schierer <lschiere@pidgin.im>
parents: 7372
diff changeset
207 plugin, GAIM_CALLBACK(reconnect));
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
208
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
209 gaim_signal_disconnect(gaim_connections_get_handle(), "signed-on",
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
210 plugin, GAIM_CALLBACK(restore_state));
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
211
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
212 gaim_signal_disconnect(gaim_accounts_get_handle(), "account-away",
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
213 plugin, GAIM_CALLBACK(save_state));
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
214
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
215 g_hash_table_destroy(hash);
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
216 hash = NULL;
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
217
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
218 g_hash_table_destroy(awayStates);
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
219 awayStates = NULL;
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
220
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
221 gaim_connections_set_ui_ops(old_ops);
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
222 g_free(new_ops);
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
223 old_ops = new_ops = NULL;
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
224
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
225 return TRUE;
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 2398
diff changeset
226 }
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 2398
diff changeset
227
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
228
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
229 static GaimPluginPrefFrame *get_plugin_pref_frame(GaimPlugin *plugin) {
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
230 GaimPluginPrefFrame *frame = gaim_plugin_pref_frame_new();
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
231 GaimPluginPref *pref;
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
232
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
233 pref = gaim_plugin_pref_new_with_label(_("Error Message Suppression"));
9549
d80ed3ba45a4 [gaim-migrate @ 10378]
Luke Schierer <lschiere@pidgin.im>
parents: 9546
diff changeset
234 gaim_plugin_pref_frame_add(frame, pref);
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
235
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
236 pref = gaim_plugin_pref_new_with_name_and_label(OPT_HIDE_CONNECTED,
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
237 _("Hide Disconnect Errors"));
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
238 gaim_plugin_pref_frame_add(frame, pref);
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
239
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
240 pref = gaim_plugin_pref_new_with_name_and_label(OPT_HIDE_CONNECTING,
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
241 _("Hide Login Errors"));
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
242 gaim_plugin_pref_frame_add(frame, pref);
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
243
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
244 pref = gaim_plugin_pref_new_with_name_and_label(OPT_RESTORE_STATE,
9666
14c1ffd053e5 [gaim-migrate @ 10518]
Luke Schierer <lschiere@pidgin.im>
parents: 9549
diff changeset
245 _("Restore Away State On Reconnect"));
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
246 gaim_plugin_pref_frame_add(frame, pref);
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
247
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
248 return frame;
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
249 }
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
250
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
251
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
252 static GaimPluginUiInfo pref_info = {
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
253 get_plugin_pref_frame
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
254 };
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
255
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
256
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
257 static GaimPluginInfo info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
258 {
8749
d7b8eb1f0a18 [gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents: 8250
diff changeset
259 GAIM_PLUGIN_API_VERSION, /**< api_version */
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
260 GAIM_PLUGIN_STANDARD, /**< type */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
261 NULL, /**< ui_requirement */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
262 0, /**< flags */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
263 NULL, /**< dependencies */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
264 GAIM_PRIORITY_DEFAULT, /**< priority */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
265
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
266 AUTORECON_PLUGIN_ID, /**< id */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
267 N_("Auto-Reconnect"), /**< name */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
268 VERSION, /**< version */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
269 /** summary */
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
270 N_("When you are kicked offline, this reconnects you."),
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
271 /** description */
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
272 N_("When you are kicked offline, this reconnects you."),
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
273 "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
274 GAIM_WEBSITE, /**< homepage */
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
275
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
276 plugin_load, /**< load */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
277 plugin_unload, /**< unload */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
278 NULL, /**< destroy */
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
279
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
280 NULL, /**< ui_info */
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
281 NULL, /**< extra_info */
8993
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8774
diff changeset
282 &pref_info, /**< prefs_info */
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8774
diff changeset
283 NULL
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
284 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
285
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
286
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
287 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5873
diff changeset
288 init_plugin(GaimPlugin *plugin)
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4590
diff changeset
289 {
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
290 gaim_prefs_add_none(AUTORECON_OPT);
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
291 gaim_prefs_add_bool(OPT_HIDE_CONNECTED, FALSE);
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
292 gaim_prefs_add_bool(OPT_HIDE_CONNECTING, FALSE);
9546
ebbe4390f75b [gaim-migrate @ 10375]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
293 gaim_prefs_add_bool(OPT_RESTORE_STATE, TRUE);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 2398
diff changeset
294 }
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 2398
diff changeset
295
6063
5239a3b4ab33 [gaim-migrate @ 6513]
Nathan Walp <nwalp@pidgin.im>
parents: 5920
diff changeset
296 GAIM_INIT_PLUGIN(autorecon, init_plugin, info)
8774
5205743477bb [gaim-migrate @ 9536]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
297