changeset 26147:4e378c8b5c49

Remove bug that crashed pidgin when sending p2p pkt to a buddy not on server list
author Sulabh Mahajan <sulabh@soc.pidgin.im>
date Fri, 22 Aug 2008 19:27:31 +0000
parents 9c633c83caa6
children 7446f0597150
files libpurple/protocols/yahoo/yahoo.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Fri Aug 22 18:48:03 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Fri Aug 22 19:27:31 2008 +0000
@@ -2642,14 +2642,14 @@
 	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;
+
 	/* Dont send p2p packet to buddies of other protocols */
 	if(f->protocol)
 		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;
-
 	public_ip = purple_network_get_public_ip();
 	if( (sscanf(public_ip, "%u.%u.%u.%u", &temp[0], &temp[1], &temp[2], &temp[3])) !=4 )
 		return ;