comparison src/connection.c @ 5564:187c740f2a4e

[gaim-migrate @ 5966] Committing what I have so far. Some new functions, and msn is almost done. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 30 May 2003 18:04:45 +0000
parents 9eb5b13fd412
children 113090160626
comparison
equal deleted inserted replaced
5563:9eb5b13fd412 5564:187c740f2a4e
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 22 */
23 #include "connection.h" 23 #include "connection.h"
24 24
25 static GList *connections = NULL; 25 static GList *connections = NULL;
26 static GList *connections_connecting = NULL;
26 static GaimConnectionUiOps *connection_ui_ops = NULL; 27 static GaimConnectionUiOps *connection_ui_ops = NULL;
27 28
28 GaimConnection * 29 GaimConnection *
29 gaim_connection_new(GaimAccount *account) 30 gaim_connection_new(GaimAccount *account)
30 { 31 {
169 GList *wins; 170 GList *wins;
170 GList *add_buds=NULL; 171 GList *add_buds=NULL;
171 172
172 /* Set the time the account came online */ 173 /* Set the time the account came online */
173 time(&gc->login_time); 174 time(&gc->login_time);
175
176 connections_connecting = g_list_append(connections_connecting, gc);
174 177
175 if (ops != NULL && ops->connected != NULL) 178 if (ops != NULL && ops->connected != NULL)
176 ops->connected(gc); 179 ops->connected(gc);
177 180
178 gaim_blist_show(); 181 gaim_blist_show();
229 g_list_free(add_buds); 232 g_list_free(add_buds);
230 } 233 }
231 234
232 serv_set_permit_deny(gc); 235 serv_set_permit_deny(gc);
233 } 236 }
237 else {
238 connections_connecting = g_list_remove(connections_connecting, gc);
239 }
234 } 240 }
235 241
236 void 242 void
237 gaim_connection_set_account(GaimConnection *gc, GaimAccount *account) 243 gaim_connection_set_account(GaimConnection *gc, GaimAccount *account)
238 { 244 {
293 if (ops != NULL && ops->connect_progress != NULL) 299 if (ops != NULL && ops->connect_progress != NULL)
294 ops->connect_progress(gc, text, step, count); 300 ops->connect_progress(gc, text, step, count);
295 } 301 }
296 302
297 void 303 void
304 gaim_connection_error(GaimConnection *gc, const char *text)
305 {
306 GaimConnectionUiOps *ops;
307
308 g_return_if_fail(gc != NULL);
309 g_return_if_fail(text != NULL);
310
311 ops = gaim_get_connection_ui_ops();
312
313 gaim_connection_disconnect(gc);
314
315 if (ops != NULL && ops->disconnected != NULL)
316 ops->disconnected(gc, text);
317
318 gaim_connection_destroy(gc);
319 }
320
321 void
298 gaim_connections_disconnect_all(void) 322 gaim_connections_disconnect_all(void)
299 { 323 {
300 GList *l; 324 GList *l;
301 325
302 for (l = gaim_connections_get_all(); l != NULL; l = l->next) 326 for (l = gaim_connections_get_all(); l != NULL; l = l->next)