soc.2008.yahoo: 4d6e3575: Fix a bug, which results in trying to se...

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Tue Jul 22 15:46:35 EDT 2008


-----------------------------------------------------------------
Revision: 4d6e35759a5ef61e7c8223241e654d7fcd2e0936
Ancestor: 5565413d2cdefc3d89e5588066f115ea43ee462e
Author: sulabh at soc.pidgin.im
Date: 2008-07-22T18:57:02
Branch: im.pidgin.soc.2008.yahoo
URL: http://d.pidgin.im/viewmtn/revision/info/4d6e35759a5ef61e7c8223241e654d7fcd2e0936

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

ChangeLog: 

Fix a bug, which results in trying to setup a p2p connection to self

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	10b90bce9a9ce44a8f6f49f288249c073caf6c46
+++ libpurple/protocols/yahoo/yahoo.c	73fb00e6d42c9f8b35e96477e399920ee4a484a2
@@ -2597,6 +2597,11 @@ static void yahoo_send_p2p_pkt(PurpleCon
 
 	f = yahoo_friend_find(gc, who);
 	account = purple_connection_get_account(gc);
+
+	/* One shouldn't try to connect to self */
+	if( strcmp(purple_normalize(account, purple_account_get_username(account)), who) == 0)
+		return;
+
 	/* send packet to only those friends who arent p2p connected and to whom we havent already sent. Do not send if this condition doesn't hold good */ 
 	if( !( f && (yahoo_friend_get_p2p_status(f) == YAHOO_P2PSTATUS_NOT_CONNECTED) && (f->p2p_packet_sent == 0)) )
 		return;


More information about the Commits mailing list