# HG changeset patch # User Sulabh Mahajan # Date 1215890674 0 # Node ID 38d188685f2fe741dc94bc8cbace2e6313525d8c # Parent c3c5e79b4ecce0ea7fd306f8216e3f73828c7623 changed gboolean connection_type to enum yahoo_p2p_connection_type diff -r c3c5e79b4ecc -r 38d188685f2f libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Sat Jul 12 19:13:31 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Sat Jul 12 19:24:34 2008 +0000 @@ -2550,7 +2550,7 @@ p2p_data->host_username = (char *)g_malloc(strlen(who)); strcpy(p2p_data->host_username, who); p2p_data->val_13 = val_13; - p2p_data->connection_type = 1; /*0:we are server*/ + p2p_data->connection_type = YAHOO_P2P_WE_ARE_SERVER; purple_network_listen(YAHOO_PAGER_PORT_P2P, SOCK_STREAM, yahoo_p2p_server_listen_cb, p2p_data); @@ -2696,7 +2696,7 @@ p2p_data->session_id = val_11; p2p_data->host_ip = host_ip; p2p_data->gc = gc; - p2p_data->connection_type = 0; /*0:peer is server*/ + p2p_data->connection_type = YAHOO_P2P_WE_ARE_CLIENT; /*connect to host*/ if((purple_proxy_connect(NULL, account, host_ip, YAHOO_PAGER_PORT_P2P, yahoo_p2p_init_cb, p2p_data))==NULL) { diff -r c3c5e79b4ecc -r 38d188685f2f libpurple/protocols/yahoo/yahoo.h --- a/libpurple/protocols/yahoo/yahoo.h Sat Jul 12 19:13:31 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.h Sat Jul 12 19:24:34 2008 +0000 @@ -89,6 +89,11 @@ YAHOO_PKT_TYPE_P2P } yahoo_pkt_type; +typedef enum { + YAHOO_P2P_WE_ARE_CLIENT =0, + YAHOO_P2P_WE_ARE_SERVER +} yahoo_p2p_connection_type; + enum yahoo_status { YAHOO_STATUS_AVAILABLE = 0, YAHOO_STATUS_BRB, @@ -126,7 +131,7 @@ guint input_event; gint source; int session_id; - gboolean connection_type; /* 0: peer is server, 1: we are server*/ + yahoo_p2p_connection_type connection_type; }; struct _YchtConn; diff -r c3c5e79b4ecc -r 38d188685f2f libpurple/protocols/yahoo/yahoo_filexfer.c --- a/libpurple/protocols/yahoo/yahoo_filexfer.c Sat Jul 12 19:13:31 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Sat Jul 12 19:24:34 2008 +0000 @@ -1502,7 +1502,7 @@ yd = gc->proto_data; p2p_data = g_hash_table_lookup(yd->peers, xfer->who); - if( p2p_data->connection_type == 1 ) + if( p2p_data->connection_type == YAHOO_P2P_WE_ARE_SERVER ) if(purple_network_listen_range(0, 0, SOCK_STREAM, yahoo_p2p_ft_server_listen_cb, xfer)) return; @@ -1796,7 +1796,7 @@ } else if(val_249 == 2) { p2p_data = g_hash_table_lookup(yd->peers, xfer->who); - if( !( p2p_data && (p2p_data->connection_type == 1) ) ) { + if( !( p2p_data && (p2p_data->connection_type == YAHOO_P2P_WE_ARE_SERVER) ) ) { purple_xfer_cancel_remote(xfer); return; }