diff libpurple/protocols/gg/gg.c @ 23243:56d88bfeed76

Restore status on login on GG, rather than setting Available first. The rest of a patch by Adam "OnO" Strzelecki; references #5693. Fixes #5137.
author Will Thompson <will.thompson@collabora.co.uk>
date Thu, 29 May 2008 12:23:51 +0000
parents 8522f594157c
children 56cf59d028f7 3da0957e7821
line wrap: on
line diff
--- a/libpurple/protocols/gg/gg.c	Thu May 29 12:17:05 2008 +0000
+++ b/libpurple/protocols/gg/gg.c	Thu May 29 12:23:51 2008 +0000
@@ -1491,23 +1491,12 @@
 			break;
 		case GG_EVENT_CONN_SUCCESS:
 			{
-				PurpleAccount *account;
-				PurplePresence *presence;
-				PurpleStatus *status;
-
 				purple_debug_info("gg", "GG_EVENT_CONN_SUCCESS\n");
 				purple_input_remove(gc->inpa);
 				gc->inpa = purple_input_add(info->session->fd,
 							  PURPLE_INPUT_READ,
 							  ggp_callback_recv, gc);
 
-				/* gg_change_status(info->session, GG_STATUS_AVAIL); */
-
-				account = purple_connection_get_account(gc);
-				presence = purple_account_get_presence(account);
-				status = purple_presence_get_active_status(presence);
-
-				ggp_set_status(account, status);
 				purple_connection_set_state(gc, PURPLE_CONNECTED);
 				ggp_buddylist_send(gc);
 			}
@@ -1695,6 +1684,8 @@
 static void ggp_login(PurpleAccount *account)
 {
 	PurpleConnection *gc;
+	PurplePresence *presence;
+	PurpleStatus *status;
 	struct gg_login_params *glp;
 	GGPInfo *info;
 
@@ -1717,8 +1708,11 @@
 	glp->uin = ggp_get_uin(account);
 	glp->password = (char *)purple_account_get_password(account);
 
+	presence = purple_account_get_presence(account);
+	status = purple_presence_get_active_status(presence);
+
 	glp->async = 1;
-	glp->status = GG_STATUS_AVAIL;
+	glp->status = ggp_to_gg_status(status, &glp->status_descr);
 	glp->tls = 0;
 
 	info->session = gg_login(glp);