diff 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
line wrap: on
line diff
--- a/src/connection.c	Sun Mar 27 17:39:22 2005 +0000
+++ b/src/connection.c	Sun Mar 27 17:50:35 2005 +0000
@@ -27,6 +27,7 @@
 #include "blist.h"
 #include "connection.h"
 #include "debug.h"
+#include "gaim.h"
 #include "log.h"
 #include "notify.h"
 #include "prefs.h"
@@ -103,7 +104,7 @@
 	}
 	else
 	{
-		if ((password == NULL) &&
+		if (((password == NULL) || (*password == '\0')) &&
 			!(prpl_info->options & OPT_PROTO_NO_PASSWORD) &&
 			!(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL))
 		{
@@ -115,7 +116,8 @@
 
 	gc = g_new0(GaimConnection, 1);
 	gc->prpl = prpl;
-	gc->password = g_strdup(password);
+	if ((password != NULL) && (*password != '\0'))
+		gc->password = g_strdup(password);
 	gaim_connection_set_account(gc, account);
 	gaim_connection_set_state(gc, GAIM_CONNECTING);
 	connections = g_list_append(connections, gc);
@@ -331,6 +333,15 @@
 		serv_set_permit_deny(gc);
 
 		update_keepalive(gc, TRUE);
+
+		if (gaim_account_get_user_info(account) != NULL)
+			serv_set_info(gc, gaim_account_get_user_info(account));
+
+		if (gc->idle_timer > 0)
+			gaim_timeout_remove(gc->idle_timer);
+
+		gc->idle_timer = gaim_timeout_add(20000, check_idle, gc);
+		serv_touch_idle(gc);
 	}
 	else if (gc->state == GAIM_DISCONNECTED) {
 		GaimAccount *account = gaim_connection_get_account(gc);