diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-22 14:31:53 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-22 14:31:53 +0100 | 
| commit | 241f9f6d9135048578ad603485740b73402edd8a (patch) | |
| tree | e10cfa2b710d5d52250a1785a88d01721555e7f7 | |
| parent | 1bb1e012f1d62db84d331a484abf9cb4c191e8e0 (diff) | |
Better handling of yahoo add responses: libyahoo2 seems to (IMHO) wrongly
assume that a non-0 status means the contact is on the list already and
on-line. This causes ugly "imcb_buddy_status() for unknown handle" msgs.
| -rw-r--r-- | protocols/yahoo/libyahoo2.c | 19 | 
1 files changed, 19 insertions, 0 deletions
| diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index b062e7f9..07689809 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -2168,6 +2168,18 @@ static void yahoo_process_buddyadd(struct yahoo_input_data *yid,  	yd->buddies = y_list_append(yd->buddies, bud); +#if 0 +	/* BitlBee: This seems to be wrong in my experience. I think: +	   status = 0: Success +	   status = 2: Already on list +	   status = 3: Doesn't exist +	   status = 42: Invalid handle (possibly banned/reserved, I get it for +	                handles like joe or jjjjjj) +	   Haven't seen others yet. But whenever the add is successful, there +	   will be a separate "went online" packet when the auth. request is +	   accepted. Couldn't find any test account that doesn't require auth. +	   unfortunately (if there is even such a thing?) */ +	     	/* A non-zero status (i've seen 2) seems to mean the buddy is already   	 * added and is online */  	if (status) { @@ -2176,6 +2188,13 @@ static void yahoo_process_buddyadd(struct yahoo_input_data *yid,  		YAHOO_CALLBACK(ext_yahoo_status_changed) (yd->client_id, who,  			YAHOO_STATUS_AVAILABLE, NULL, 0, 0, 0);  	} +#endif +	/* BitlBee: Need ACK of added buddy, if it was successful. */ +	if (status == 0) { +		YList *tmp = y_list_append(NULL, bud); +		YAHOO_CALLBACK(ext_yahoo_got_buddies) (yd->client_id, tmp); +		y_list_free(tmp); +	}  }  static void yahoo_process_buddydel(struct yahoo_input_data *yid, | 
