pidgin: 14cd2c46: Fixes #7722.

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Sun Aug 23 06:10:45 EDT 2009


-----------------------------------------------------------------
Revision: 14cd2c46309b8cfa9e732fa8df5ed2f096684c27
Ancestor: f7b9f6308d9e2cb23ec1d56882ff3894e46ad869
Author: sulabh at soc.pidgin.im
Date: 2009-08-23T10:07:21
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/14cd2c46309b8cfa9e732fa8df5ed2f096684c27

Modified files:
        libpurple/protocols/yahoo/libymsg.c

ChangeLog: 

Fixes #7722.
When unsetting idle while invisible, send status as available instead of invisible. This makes sure that server sends available status
to buddies we have set "show online". Hence unsets idle for such buddies.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	784ea1f5c48533a4d0caa0bb180484436ba111a3
+++ libpurple/protocols/yahoo/libymsg.c	e5b07fdf6141235f4492d18407a05424ce605011
@@ -4500,8 +4500,6 @@ void yahoo_set_status(PurpleAccount *acc
 
 	if (purple_presence_is_idle(presence))
 		yahoo_packet_hash_str(pkt, 47, "2");
-	else if (!purple_status_is_available(status))
-		yahoo_packet_hash_str(pkt, 47, "1");
 
 	yahoo_packet_send_and_free(pkt, yd);
 
@@ -4522,6 +4520,7 @@ void yahoo_set_idle(PurpleConnection *gc
 	struct yahoo_packet *pkt = NULL;
 	char *msg = NULL, *msg2 = NULL;
 	PurpleStatus *status = NULL;
+	gboolean invisible = FALSE;
 
 	if (idle && yd->current_status != YAHOO_STATUS_CUSTOM)
 		yd->current_status = YAHOO_STATUS_IDLE;
@@ -4530,9 +4529,15 @@ void yahoo_set_idle(PurpleConnection *gc
 		yd->current_status = get_yahoo_status_from_purple_status(status);
 	}
 
+	invisible = !( purple_presence_is_available(purple_account_get_presence(purple_connection_get_account(gc))) );
+
 	pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, YAHOO_STATUS_AVAILABLE, yd->session_id);
 
-	yahoo_packet_hash_int(pkt, 10, yd->current_status);
+	if (!idle && invisible)
+		yahoo_packet_hash_int(pkt, 10, YAHOO_STATUS_AVAILABLE);
+	else
+		yahoo_packet_hash_int(pkt, 10, yd->current_status);
+
 	if (yd->current_status == YAHOO_STATUS_CUSTOM) {
 		const char *tmp;
 		if (status == NULL)
@@ -4555,8 +4560,6 @@ void yahoo_set_idle(PurpleConnection *gc
 
 	if (idle)
 		yahoo_packet_hash_str(pkt, 47, "2");
-	else if (!purple_presence_is_available(purple_account_get_presence(purple_connection_get_account(gc))))
-		yahoo_packet_hash_str(pkt, 47, "1");
 
 	yahoo_packet_send_and_free(pkt, yd);
 


More information about the Commits mailing list