comparison src/account.c @ 5879:d58406d31a1a

[gaim-migrate @ 6311] Too many things can go wrong with gaim_accounts_get_active(), so I'm taking it out and modifying the accounts drop-down box to just use gaim_connections_get_all() instead. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 15 Jun 2003 04:58:09 +0000
parents f336fc0a7b8b
children 6c22d37c6a3c
comparison
equal deleted inserted replaced
5878:9e54bb2ee3b5 5879:d58406d31a1a
78 gboolean in_proxy; 78 gboolean in_proxy;
79 79
80 } AccountParserData; 80 } AccountParserData;
81 81
82 static GList *accounts = NULL; 82 static GList *accounts = NULL;
83 static GList *active_accounts = NULL;
84 static guint accounts_save_timer = 0; 83 static guint accounts_save_timer = 0;
85 static gboolean accounts_loaded = FALSE; 84 static gboolean accounts_loaded = FALSE;
86 85
87 static void 86 static void
88 delete_setting(void *data) 87 delete_setting(void *data)
169 168
170 gc = gaim_connection_new(account); 169 gc = gaim_connection_new(account);
171 170
172 gaim_connection_connect(gc); 171 gaim_connection_connect(gc);
173 172
174 if (gaim_account_is_connected(account))
175 active_accounts = g_list_append(active_accounts, account);
176
177 return gc; 173 return gc;
178 } 174 }
179 175
180 void 176 void
181 gaim_account_disconnect(GaimAccount *account) 177 gaim_account_disconnect(GaimAccount *account)
182 { 178 {
183 g_return_if_fail(account != NULL); 179 g_return_if_fail(account != NULL);
184 g_return_if_fail(gaim_account_is_connected(account)); 180 g_return_if_fail(gaim_account_is_connected(account));
185 181
186 gaim_connection_disconnect(account->gc); 182 gaim_connection_disconnect(account->gc);
187
188 active_accounts = g_list_remove(active_accounts, account);
189 183
190 account->gc = NULL; 184 account->gc = NULL;
191 } 185 }
192 186
193 void 187 void
1269 gaim_accounts_get_all(void) 1263 gaim_accounts_get_all(void)
1270 { 1264 {
1271 return accounts; 1265 return accounts;
1272 } 1266 }
1273 1267
1274 GList *
1275 gaim_accounts_get_active(void)
1276 {
1277 return active_accounts;
1278 }
1279
1280 GaimAccount * 1268 GaimAccount *
1281 gaim_accounts_find(const char *name, GaimProtocol protocol) 1269 gaim_accounts_find(const char *name, GaimProtocol protocol)
1282 { 1270 {
1283 GaimAccount *account = NULL; 1271 GaimAccount *account = NULL;
1284 GList *l; 1272 GList *l;