Fix a bug, which results in trying to setup a p2p connection to self soc.2008.yahoo

Tue, 22 Jul 2008 18:57:02 +0000

author
Sulabh Mahajan <sulabh@pidgin.im>
date
Tue, 22 Jul 2008 18:57:02 +0000
branch
soc.2008.yahoo
changeset 26346
6df80909c5a6
parent 26345
cee88d89b5e8
child 26347
f99dc5025704

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

libpurple/protocols/yahoo/yahoo.c file | annotate | diff | comparison | revisions
--- 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;

mercurial