# HG changeset patch # User Sulabh Mahajan # Date 1251022041 0 # Node ID ea6e571ebe4d3edff29c4034c90efd2a854541fa # Parent afa79877d972827166ea56c22b461f63d3504870 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. diff -r afa79877d972 -r ea6e571ebe4d libpurple/protocols/yahoo/libymsg.c --- a/libpurple/protocols/yahoo/libymsg.c Sun Aug 23 09:12:32 2009 +0000 +++ b/libpurple/protocols/yahoo/libymsg.c Sun Aug 23 10:07:21 2009 +0000 @@ -4500,8 +4500,6 @@ 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 @@ 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 @@ 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 @@ 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);