changeset 21533:178fe7d45700

Fix receiving files from Gajim clients by making the SOCKS5 target hash correct.
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 15 Nov 2007 23:37:36 +0000
parents 0e9129f83906
children cd83003d61f4
files ChangeLog libpurple/protocols/bonjour/bonjour_ft.c
diffstat 2 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Nov 15 22:01:48 2007 +0000
+++ b/ChangeLog	Thu Nov 15 23:37:36 2007 +0000
@@ -8,8 +8,9 @@
 	  catch deprecated functions earlier rather than later.
 	* Thanks to a patch from Intel, the Bonjour prpl now supports file
 	  transfers using XEP-0096 and XEP-0065.  This should enable file
-	  transfers between libpurple clients, but will not work with iChat
-	  or Adium as they use a different file transfer implementation.
+	  transfers between libpurple clients and Gajim clients, but will not
+	  work with iChat or Adium as they use a different file transfer
+	  implementation.
 
 	Pidgin:
 	* If a plugin says it can't be unloaded, we now display an error and
--- a/libpurple/protocols/bonjour/bonjour_ft.c	Thu Nov 15 22:01:48 2007 +0000
+++ b/libpurple/protocols/bonjour/bonjour_ft.c	Thu Nov 15 23:37:36 2007 +0000
@@ -33,7 +33,7 @@
 static void
 bonjour_bytestreams_init(PurpleXfer *xfer);
 static void
-bonjour_bytestreams_connect(PurpleXfer *xfer);
+bonjour_bytestreams_connect(PurpleXfer *xfer, PurpleBuddy *pb);
 static void
 bonjour_xfer_init(PurpleXfer *xfer);
 static void
@@ -546,7 +546,7 @@
 							xf->proxy_port = portnum;
 							purple_debug_info("bonjour", "bytestream offer parse"
 									  "jid=%s host=%s port=%d.\n", jid, host, portnum);
-							bonjour_bytestreams_connect(xfer);
+							bonjour_bytestreams_connect(xfer, pb);
 							found = TRUE;
 							break;
 						}
@@ -815,13 +815,17 @@
 	xmlnode *q_node, *tmp_node;
 	BonjourData *bd;
 
-	if(data == NULL || source < 0) {
+	if(source < 0) {
+		purple_debug_error("bonjour", "Error connecting via SOCKS5 - %s\n",
+			error_message ? error_message : "(null)");
 		xep_ft_si_reject(xf->data, xf->iq_id, xfer->who, "404", "cancel");
 		/* Cancel the connection */
 		purple_xfer_cancel_local(xfer);
 		return;
 	}
 
+	purple_debug_info("bonjour", "Connected successfully via SOCKS5, starting transfer.\n");
+
 	bd = xf->data;
 
 	purple_proxy_info_destroy(xf->proxy_info);
@@ -841,7 +845,7 @@
 }
 
 static void
-bonjour_bytestreams_connect(PurpleXfer *xfer)
+bonjour_bytestreams_connect(PurpleXfer *xfer, PurpleBuddy *pb)
 {
 	XepXfer *xf = NULL;
 	char dstaddr[41];
@@ -858,7 +862,7 @@
 	if(!xf)
 		return;
 
-	p = g_strdup_printf("%s@%s", xf->sid, xfer->who);
+	p = g_strdup_printf("%s%s%s", xf->sid, pb->name, purple_account_get_username(pb->account));
 	purple_cipher_digest_region("sha1", (guchar *)p, strlen(p),
 				    sizeof(hashval), hashval, NULL);
 	g_free(p);