changeset 26140:c031f88aa026

Fix a bug, which results in trying to setup a p2p connection to self
author Sulabh Mahajan <sulabh@soc.pidgin.im>
date Tue, 22 Jul 2008 18:57:02 +0000
parents 1cf212ba3926
children 0e1fba363b01
files libpurple/protocols/yahoo/yahoo.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;