comparison src/connection.c @ 10751:bf5e48215158

[gaim-migrate @ 12354] Get rid of serv_finish_login because it's dumb. Also fix some problems with gg and silc that I introduced yesterday. I didn't grep for places where account->password was accessed directly. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 27 Mar 2005 17:50:35 +0000
parents ca69d597a5e2
children 8a97b59f0071
comparison
equal deleted inserted replaced
10750:d5a00882d118 10751:bf5e48215158
25 #include "internal.h" 25 #include "internal.h"
26 #include "account.h" 26 #include "account.h"
27 #include "blist.h" 27 #include "blist.h"
28 #include "connection.h" 28 #include "connection.h"
29 #include "debug.h" 29 #include "debug.h"
30 #include "gaim.h"
30 #include "log.h" 31 #include "log.h"
31 #include "notify.h" 32 #include "notify.h"
32 #include "prefs.h" 33 #include "prefs.h"
33 #include "request.h" 34 #include "request.h"
34 #include "server.h" 35 #include "server.h"
101 if (prpl_info->register_user == NULL) 102 if (prpl_info->register_user == NULL)
102 return; 103 return;
103 } 104 }
104 else 105 else
105 { 106 {
106 if ((password == NULL) && 107 if (((password == NULL) || (*password == '\0')) &&
107 !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && 108 !(prpl_info->options & OPT_PROTO_NO_PASSWORD) &&
108 !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) 109 !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL))
109 { 110 {
110 gaim_debug_error("connection", "Can not connect to account %s without " 111 gaim_debug_error("connection", "Can not connect to account %s without "
111 "a password.\n", gaim_account_get_username(account)); 112 "a password.\n", gaim_account_get_username(account));
113 } 114 }
114 } 115 }
115 116
116 gc = g_new0(GaimConnection, 1); 117 gc = g_new0(GaimConnection, 1);
117 gc->prpl = prpl; 118 gc->prpl = prpl;
118 gc->password = g_strdup(password); 119 if ((password != NULL) && (*password != '\0'))
120 gc->password = g_strdup(password);
119 gaim_connection_set_account(gc, account); 121 gaim_connection_set_account(gc, account);
120 gaim_connection_set_state(gc, GAIM_CONNECTING); 122 gaim_connection_set_state(gc, GAIM_CONNECTING);
121 connections = g_list_append(connections, gc); 123 connections = g_list_append(connections, gc);
122 gaim_account_set_connection(account, gc); 124 gaim_account_set_connection(account, gc);
123 125
329 } 331 }
330 332
331 serv_set_permit_deny(gc); 333 serv_set_permit_deny(gc);
332 334
333 update_keepalive(gc, TRUE); 335 update_keepalive(gc, TRUE);
336
337 if (gaim_account_get_user_info(account) != NULL)
338 serv_set_info(gc, gaim_account_get_user_info(account));
339
340 if (gc->idle_timer > 0)
341 gaim_timeout_remove(gc->idle_timer);
342
343 gc->idle_timer = gaim_timeout_add(20000, check_idle, gc);
344 serv_touch_idle(gc);
334 } 345 }
335 else if (gc->state == GAIM_DISCONNECTED) { 346 else if (gc->state == GAIM_DISCONNECTED) {
336 GaimAccount *account = gaim_connection_get_account(gc); 347 GaimAccount *account = gaim_connection_get_account(gc);
337 348
338 if(gaim_prefs_get_bool("/core/logging/log_system") && 349 if(gaim_prefs_get_bool("/core/logging/log_system") &&