diff options
| -rw-r--r-- | protocols/yahoo/libyahoo2.c | 5 | ||||
| -rw-r--r-- | protocols/yahoo/yahoo.c | 6 | 
2 files changed, 6 insertions, 5 deletions
| diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index 20e284f7..721f4b7c 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -4086,9 +4086,6 @@ void yahoo_send_typing(int id, const char *from, const char *who, int typ)  	yahoo_packet_free(pkt);  } -/* TODO(wilmer): See if this this function still works since I got rid of a -                 lot of things that seemed illogical. Some things may have -                 been intentional. */  void yahoo_set_away(int id, enum yahoo_status state, const char *msg, int away)  {  	struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER); @@ -4117,7 +4114,7 @@ void yahoo_set_away(int id, enum yahoo_status state, const char *msg, int away)  	pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, yd->current_status, yd->session_id);  	snprintf(s, sizeof(s), "%d", yd->current_status);  	yahoo_packet_hash(pkt, 10, s); -	yahoo_packet_hash(pkt, 19, msg); +	yahoo_packet_hash(pkt, 19, msg && state == YAHOO_STATUS_CUSTOM ? msg : "");  	yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0");  	yahoo_send_packet(yid, pkt, 0);  	yahoo_packet_free(pkt); diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 78a8eb8a..a47de966 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -199,8 +199,10 @@ static void byahoo_set_away( struct im_connection *ic, char *state, char *msg )  {  	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; -	if( state ) +	if( state && msg == NULL )  	{ +		/* Use these states only if msg doesn't contain additional +		   info since away messages are only supported with CUSTOM. */  		if( g_strcasecmp( state, "Be Right Back" ) == 0 )  			yd->current_status = YAHOO_STATUS_BRB;  		else if( g_strcasecmp( state, "Busy" ) == 0 ) @@ -224,6 +226,8 @@ static void byahoo_set_away( struct im_connection *ic, char *state, char *msg )  		else  			yd->current_status = YAHOO_STATUS_CUSTOM;  	} +	else if( state ) +		yd->current_status = YAHOO_STATUS_CUSTOM;  	else  		yd->current_status = YAHOO_STATUS_AVAILABLE; | 
