diff src/protocols/yahoo/yahoo.c @ 10755:fffc664d5294

[gaim-migrate @ 12358] Some TLC for Jabber and Yahoo!. Jabber no longer crashes at signoff. Is Left Eye Lopez the one that burned down that guy's house? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 27 Mar 2005 19:29:18 +0000
parents bf5e48215158
children c29edc9a5e40
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Sun Mar 27 19:12:52 2005 +0000
+++ b/src/protocols/yahoo/yahoo.c	Sun Mar 27 19:29:18 2005 +0000
@@ -2760,6 +2760,7 @@
 static void yahoo_set_status(GaimAccount *account, GaimStatus *status)
 {
 	GaimConnection *gc = gaim_account_get_connection(account);
+	gboolean connected = gaim_account_is_connected(account);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 	int old_status;
@@ -2770,14 +2771,17 @@
 	id = gaim_status_get_id(status);
 	if (!gaim_status_is_active(status))
 		return;
-	if (strcmp(id, YAHOO_STATUS_TYPE_OFFLINE) && !gc) {
+	if (strcmp(id, YAHOO_STATUS_TYPE_OFFLINE) && !connected) {
 		gaim_account_connect(account);
 		return;
-	} else if (!strcmp(id, YAHOO_STATUS_TYPE_OFFLINE) && gc) {
+	} else if (!strcmp(id, YAHOO_STATUS_TYPE_OFFLINE) && connected) {
 		gaim_account_disconnect(account);
 		return;
 	}
 
+	if (!connected)
+		return;
+
 	yd = (struct yahoo_data *)gc->proto_data;
 	old_status = yd->current_status;