# HG changeset patch # User Sulabh Mahajan # Date 1219417216 0 # Node ID abf830f6cd43c79c9690916d1aa5ea68fd7c34c5 # Parent 0dd4629e75eee3844068ed6dfba7920d572ee97a When sending a file, if there isn't a p2p connection, try establishing it. one. diff -r 0dd4629e75ee -r abf830f6cd43 libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Wed Aug 20 21:37:09 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Fri Aug 22 15:00:16 2008 +0000 @@ -2622,7 +2622,7 @@ } /* 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]; diff -r 0dd4629e75ee -r abf830f6cd43 libpurple/protocols/yahoo/yahoo.h --- a/libpurple/protocols/yahoo/yahoo.h Wed Aug 20 21:37:09 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.h Fri Aug 22 15:00:16 2008 +0000 @@ -274,4 +274,7 @@ 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_ */ diff -r 0dd4629e75ee -r abf830f6cd43 libpurple/protocols/yahoo/yahoo_filexfer.c --- a/libpurple/protocols/yahoo/yahoo_filexfer.c Wed Aug 20 21:37:09 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Fri Aug 22 15:00:16 2008 +0000 @@ -1047,6 +1047,10 @@ 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);