changeset 10908:0317ad172e8d

[gaim-migrate @ 12640] Fix Fedora bug 149849 - Gaim's msn will fail to connect if you set it to "away" while connecting committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Mon, 09 May 2005 12:43:52 +0000
parents 4f5fa4cc7eb4
children bd6c0aa9ff6c
files src/protocols/msn/session.c src/protocols/msn/state.c
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/session.c	Sun May 08 16:15:11 2005 +0000
+++ b/src/protocols/msn/session.c	Mon May 09 12:43:52 2005 +0000
@@ -412,10 +412,11 @@
 	msn_user_set_buddy_icon(session->user,
 							gaim_account_get_buddy_icon(session->account));
 
-	msn_change_status(session, MSN_ONLINE);
+	session->logged_in = TRUE;
+
+	msn_change_status(session, session->state == 0 ? MSN_ONLINE : session->state);
 
 	gaim_connection_set_state(gc, GAIM_CONNECTED);
-	session->logged_in = TRUE;
 
 	/* Sync users */
 	msn_session_sync_users(session);
--- a/src/protocols/msn/state.c	Sun May 08 16:15:11 2005 +0000
+++ b/src/protocols/msn/state.c	Mon May 09 12:43:52 2005 +0000
@@ -52,6 +52,13 @@
 	cmdproc = session->notification->cmdproc;
 	user = session->user;
 	state_text = msn_state_get_text(state);
+	session->state = state;
+
+	/* If we're not logged in yet, don't send the status to the server,
+	 * it will be sent when login completes
+	 */
+	if (!session->logged_in)
+		return;
 
 	msnobj = msn_user_get_object(user);
 
@@ -69,12 +76,6 @@
 		msn_cmdproc_send(cmdproc, "CHG", "%s %d %s", state_text,
 						 MSN_CLIENT_ID, gaim_url_encode(msnobj_str));
 
-		/*
-		 * We need to set this just in case someone tries to set icon
-		 * quickly on us - Justin
-		 */
-		session->state = state;
-
 		g_free(msnobj_str);
 	}
 }