From: Evan S. <ev...@us...> - 2006-03-24 02:48:36
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5555 Modified Files: yahoo.c Log Message: Patch 1452620 from sadrul to improve Yahoo idle handling: "If you are away with no status-message, and you want to set the account as idle, then the account becomes `online'. When you come back from idle, and you have `away' selected in the statusbox, then the account becomes online." Index: yahoo.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v retrieving revision 1.397 retrieving revision 1.398 diff -u -d -p -r1.397 -r1.398 --- yahoo.c 8 Mar 2006 04:45:53 -0000 1.397 +++ yahoo.c 24 Mar 2006 02:48:28 -0000 1.398 @@ -3235,25 +3235,31 @@ static void yahoo_set_idle(GaimConnectio struct yahoo_data *yd = gc->proto_data; struct yahoo_packet *pkt = NULL; char *msg = NULL, *msg2 = NULL; + GaimStatus *status = NULL; - if (idle && yd->current_status == YAHOO_STATUS_AVAILABLE) + if (idle && yd->current_status != YAHOO_STATUS_IDLE) yd->current_status = YAHOO_STATUS_IDLE; - else if (!idle && yd->current_status == YAHOO_STATUS_IDLE) - yd->current_status = YAHOO_STATUS_AVAILABLE; + else if (!idle && yd->current_status == YAHOO_STATUS_IDLE) { + status = gaim_presence_get_active_status(gaim_account_get_presence(gaim_connection_get_account(gc))); + yd->current_status = get_yahoo_status_from_gaim_status(status); + } pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, YAHOO_STATUS_AVAILABLE, 0); yahoo_packet_hash_int(pkt, 10, yd->current_status); if (yd->current_status == YAHOO_STATUS_CUSTOM) { const char *tmp; - GaimStatus *status = gaim_presence_get_active_status(gaim_account_get_presence(gaim_connection_get_account(gc))); + if (status == NULL) + status = gaim_presence_get_active_status(gaim_account_get_presence(gaim_connection_get_account(gc))); tmp = gaim_status_get_attr_string(status, "message"); if (tmp != NULL) { msg = yahoo_string_encode(gc, tmp, NULL); msg2 = gaim_markup_strip_html(msg); yahoo_packet_hash_str(pkt, 19, msg2); } else { - yahoo_packet_hash_str(pkt, 19, ""); + /* get_yahoo_status_from_gaim_status() returns YAHOO_STATUS_CUSTOM for + * the generic away state (YAHOO_STATUS_TYPE_AWAY) with no message */ + yahoo_packet_hash_str(pkt, 19, _("Away")); } } else { yahoo_packet_hash_str(pkt, 19, ""); |