soc.2008.yahoo: b5a864a0: changed gboolean connection_type to enum...

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Sat Jul 12 15:51:20 EDT 2008


-----------------------------------------------------------------
Revision: b5a864a00f441e73c0fa8babad81136a96013fd5
Ancestor: 4ecf28996582dd8b6fd463ea62b1ad7f859c0ea7
Author: sulabh at soc.pidgin.im
Date: 2008-07-12T19:24:34
Branch: im.pidgin.soc.2008.yahoo
URL: http://d.pidgin.im/viewmtn/revision/info/b5a864a00f441e73c0fa8babad81136a96013fd5

Modified files:
        libpurple/protocols/yahoo/yahoo.c
        libpurple/protocols/yahoo/yahoo.h
        libpurple/protocols/yahoo/yahoo_filexfer.c

ChangeLog: 

changed gboolean connection_type to enum yahoo_p2p_connection_type

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	00b946bcae83f8c408211fb8b487ea01cd1f275a
+++ libpurple/protocols/yahoo/yahoo.c	dcb12d8df4616efdad7b2582d4944c44e27c1404
@@ -2550,7 +2550,7 @@ static void yahoo_send_p2p_pkt(PurpleCon
 	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 @@ static void yahoo_process_p2p(PurpleConn
 		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)	{
============================================================
--- libpurple/protocols/yahoo/yahoo.h	beaf7b702cb5ace5a92be8ade42fa9a513da5e8e
+++ libpurple/protocols/yahoo/yahoo.h	81848856a338918bfde0098e2ee4f3dacadc600c
@@ -89,6 +89,11 @@ typedef enum {
 	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 @@ struct yahoo_p2p_data	{
 	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;
============================================================
--- libpurple/protocols/yahoo/yahoo_filexfer.c	d71b4d5fe27fbf6750107c0a466e879cb49ef319
+++ libpurple/protocols/yahoo/yahoo_filexfer.c	ec07c1ce3530436b7743bcd523644f20d0285206
@@ -1502,7 +1502,7 @@ static void yahoo_p2p_client_send_ft_inf
 	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 @@ void yahoo_process_filetrans_info_15(Pur
 	}
 	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;
 		}


More information about the Commits mailing list