# HG changeset patch # User Sulabh Mahajan # Date 1216753022 0 # Node ID c031f88aa026c22090475afb5bb4c4d6c8b25d05 # Parent 1cf212ba39261fbfd5b3ac34a3a14e76d82f6e22 Fix a bug, which results in trying to setup a p2p connection to self diff -r 1cf212ba3926 -r c031f88aa026 libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Mon Jul 21 09:07:42 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Tue Jul 22 18:57:02 2008 +0000 @@ -2597,6 +2597,11 @@ 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;