diff src/protocols/msn/msn.c @ 10646:6a618db0a404

[gaim-migrate @ 12162] Made IRC, Jabber, MSN, and ICQ not crash on login. Note that these don't necessarily work the way they should yet, they just don't crash. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 01 Mar 2005 21:15:58 +0000
parents fe919915fceb
children f2e86683cafc
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Mon Feb 28 18:18:22 2005 +0000
+++ b/src/protocols/msn/msn.c	Tue Mar 01 21:15:58 2005 +0000
@@ -823,14 +823,17 @@
 
 	gc = gaim_account_get_connection(account);
 
-	if (gc == NULL)
-		return;
-
-	session = gc->proto_data;
+	if (gc) 
+		session = gc->proto_data;
 
 	state = gaim_status_get_id(status);
 
-	if (!strcmp(state, "away"))
+	printf("%d %s\n", gc, state);
+	if (strcmp(state, "offline") && !gc) {
+		gaim_account_connect(account, status);
+		return;
+	}
+	else if (!strcmp(state, "away"))
 		msnstatus = MSN_AWAY;
 	else if (!strcmp(state, "brb"))
 		msnstatus = MSN_BRB;
@@ -846,8 +849,8 @@
 		msnstatus = MSN_IDLE;
 	else
 		msnstatus = MSN_ONLINE;
-
-	msn_change_status(session, msnstatus);
+	if (gc)
+		msn_change_status(session, msnstatus);
 }
 
 static void