diff options
Diffstat (limited to 'protocols/yahoo')
| -rw-r--r-- | protocols/yahoo/libyahoo2.c | 17 | ||||
| -rw-r--r-- | protocols/yahoo/yahoo.c | 19 | ||||
| -rw-r--r-- | protocols/yahoo/yahoo_httplib.c | 2 | 
3 files changed, 14 insertions, 24 deletions
| diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index ce38bc73..a61955c4 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -68,8 +68,6 @@ char *strchr (), *strrchr ();  #ifdef __MINGW32__  # include <winsock2.h> -# define write(a,b,c) send(a,b,c,0) -# define read(a,b,c)  recv(a,b,c,0)  #endif  #include <stdlib.h> @@ -380,7 +378,6 @@ static void del_from_list(struct yahoo_data *yd)  }  /* call repeatedly to get the next one */ -/*  static struct yahoo_input_data * find_input_by_id(int id)  {  	YList *l; @@ -391,7 +388,6 @@ static struct yahoo_input_data * find_input_by_id(int id)  	}  	return NULL;  } -*/  static struct yahoo_input_data * find_input_by_id_and_webcam_user(int id, const char * who)  { @@ -736,7 +732,7 @@ static void yahoo_send_packet(struct yahoo_input_data *yid, struct yahoo_packet  	data = y_new0(unsigned char, len + 1);  	memcpy(data + pos, "YMSG", 4); pos += 4; -	pos += yahoo_put16(data + pos, 0x0a00); +	pos += yahoo_put16(data + pos, 0x000c);  	pos += yahoo_put16(data + pos, 0x0000);  	pos += yahoo_put16(data + pos, pktlen + extra_pad);  	pos += yahoo_put16(data + pos, pkt->service); @@ -796,6 +792,7 @@ static int yahoo_send_data(int fd, void *data, int len)  void yahoo_close(int id)   {  	struct yahoo_data *yd = find_conn_by_id(id); +	  	if(!yd)  		return; @@ -3165,7 +3162,7 @@ int yahoo_write_ready(int id, int fd, void *data)  	struct data_queue *tx;  	LOG(("write callback: id=%d fd=%d data=%p", id, fd, data)); -	if(!yid || !yid->txqueues) +	if(!yid || !yid->txqueues || !find_conn_by_id(id))  		return -2;  	tx = yid->txqueues->data; @@ -3350,7 +3347,7 @@ static void yahoo_process_search_connection(struct yahoo_input_data *yid, int ov  					yct->age = atoi(cp);  					break;  				case 5:  -					if(cp != "\005") +					if(strcmp(cp, "5") != 0)  						yct->location = cp;  					k = 0;  					break; @@ -3841,11 +3838,9 @@ void yahoo_logoff(int id)  		}  	} -	 -/*	do { +	do {  		yahoo_input_close(yid); -	} while((yid = find_input_by_id(id)));*/ -	 +	} while((yid = find_input_by_id(id)));  }  void yahoo_get_list(int id) diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 52747bb4..0db6e27a 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -162,10 +162,7 @@ static void byahoo_logout( struct im_connection *ic )  	}  	g_slist_free( yd->buddygroups ); -	if( yd->logged_in ) -		yahoo_logoff( yd->y2_id ); -	else -		yahoo_close( yd->y2_id ); +	yahoo_logoff( yd->y2_id );  	g_free( yd );  } @@ -314,7 +311,7 @@ static void byahoo_chat_invite( struct groupchat *c, char *who, char *msg )  {  	struct byahoo_data *yd = (struct byahoo_data *) c->ic->proto_data; -	yahoo_conference_invite( yd->y2_id, NULL, c->data, c->title, msg ); +	yahoo_conference_invite( yd->y2_id, NULL, c->data, c->title, msg ? msg : "" );  }  static void byahoo_chat_leave( struct groupchat *c ) @@ -454,10 +451,6 @@ gboolean byahoo_write_ready_callback( gpointer data, gint source, b_input_condit  {  	struct byahoo_write_ready_data *d = data; -	if( !byahoo_get_ic_by_id( d->id ) ) -		/* WTF doesn't libyahoo clean this up? */ -		return FALSE; -	  	yahoo_write_ready( d->id, d->fd, d->data );  	return FALSE; @@ -797,16 +790,20 @@ int ext_yahoo_connect(const char *host, int port)  	return -1;  } -static void byahoo_accept_conf( gpointer w, struct byahoo_conf_invitation *inv ) +static void byahoo_accept_conf( void *data )  { +	struct byahoo_conf_invitation *inv = data; +	  	yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name );  	imcb_chat_add_buddy( inv->c, inv->ic->acc->user );  	g_free( inv->name );  	g_free( inv );  } -static void byahoo_reject_conf( gpointer w, struct byahoo_conf_invitation *inv ) +static void byahoo_reject_conf( void *data )  { +	struct byahoo_conf_invitation *inv = data; +	  	yahoo_conference_decline( inv->yid, NULL, inv->members, inv->name, "User rejected groupchat" );  	imcb_chat_free( inv->c );  	g_free( inv->name ); diff --git a/protocols/yahoo/yahoo_httplib.c b/protocols/yahoo/yahoo_httplib.c index dbbe2a84..1b084992 100644 --- a/protocols/yahoo/yahoo_httplib.c +++ b/protocols/yahoo/yahoo_httplib.c @@ -50,8 +50,6 @@ char *strchr (), *strrchr ();  #include "yahoo_debug.h"  #ifdef __MINGW32__  # include <winsock2.h> -# define write(a,b,c) send(a,b,c,0) -# define read(a,b,c)  recv(a,b,c,0)  # define snprintf _snprintf  #endif | 
