soc.2008.yahoo: b375305c: When sending a file, if there isn't a p2...

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Fri Aug 22 11:05:29 EDT 2008


-----------------------------------------------------------------
Revision: b375305cea93bbcd0db8fcc7f728c08b48c11ec8
Ancestor: c256033569aa86fd492712ddfe7453b5108aa8e8
Author: sulabh at soc.pidgin.im
Date: 2008-08-22T15:00:16
Branch: im.pidgin.soc.2008.yahoo
URL: http://d.pidgin.im/viewmtn/revision/info/b375305cea93bbcd0db8fcc7f728c08b48c11ec8

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

ChangeLog: 

When sending a file, if there isn't a p2p connection, try establishing it. 
one. 

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	38de8400f3874693632bc063dcd59fc22abef97f
+++ libpurple/protocols/yahoo/yahoo.c	b858a0a21420c93f026f32ba703a0a27bc94b547
@@ -2622,7 +2622,7 @@ static void yahoo_p2p_server_listen_cb(i
 }
 
 /* send p2p pkt containing our encoded ip, asking peer to connect to us */
-static void yahoo_send_p2p_pkt(PurpleConnection *gc, const char *who, int val_13)
+void yahoo_send_p2p_pkt(PurpleConnection *gc, const char *who, int val_13)
 {
 	const char *public_ip;
 	guint32 temp[4];	
============================================================
--- libpurple/protocols/yahoo/yahoo.h	0e9517770a5094c71de68b6e4c270f9623b84fe3
+++ libpurple/protocols/yahoo/yahoo.h	aebec94ceea2d12a8cb181b14c547f04457a9622
@@ -274,4 +274,7 @@ GList *yahoo_attention_types(PurpleAccou
 gboolean yahoo_send_attention(PurpleConnection *gc, const char *username, guint type);
 GList *yahoo_attention_types(PurpleAccount *account);
 
+/* send p2p pkt containing our encoded ip, asking peer to connect to us */
+void yahoo_send_p2p_pkt(PurpleConnection *gc, const char *who, int val_13);
+
 #endif /* _YAHOO_H_ */
============================================================
--- libpurple/protocols/yahoo/yahoo_filexfer.c	c1ec9147fbd92064afd66831994b530123953afb
+++ libpurple/protocols/yahoo/yahoo_filexfer.c	207dc7803bc547dcb032c97249de43e8078b479d
@@ -1047,6 +1047,10 @@ void yahoo_send_file(PurpleConnection *g
 
 	g_return_if_fail(xfer != NULL);
 
+	/* if we don't have a p2p connection, try establishing it now */
+	if( !g_hash_table_lookup(yd->peers, who) )
+		yahoo_send_p2p_pkt(gc, who, 0);
+
 	xfer_data = xfer->data;
 	xfer_data->status_15 = STARTED;
 	purple_xfer_set_init_fnc(xfer, yahoo_xfer_init_15);


More information about the Commits mailing list