# HG changeset patch
# User Daniel Atallah <daniel.atallah@gmail.com>
# Date 1189129967 0
# Node ID a486814031032e10fb3cef6b585e198e8a71207a
# Parent  55c47f7ab2a2ecd63b6d3ecfadac86cb6e48a254
Unregister the iq callback listener when the transfer is freed.   Fixes #1804.  It doesn't seem correct to me that nothing is sent to the recipient when the sender cancels the ft request, but that is a different issue.

diff -r 55c47f7ab2a2 -r a48681403103 libpurple/protocols/jabber/si.c
--- a/libpurple/protocols/jabber/si.c	Fri Sep 07 01:22:19 2007 +0000
+++ b/libpurple/protocols/jabber/si.c	Fri Sep 07 01:52:47 2007 +0000
@@ -708,6 +708,10 @@
 
 	jabber_iq_set_callback(iq, jabber_si_xfer_send_method_cb, xfer);
 
+	/* Store the IQ id so that we can cancel the callback */
+	g_free(jsx->iq_id);
+	jsx->iq_id = g_strdup(iq->id);
+
 	jabber_iq_send(iq);
 }
 
@@ -722,6 +726,8 @@
 		purple_proxy_connect_cancel(jsx->connect_data);
 	if (jsx->listen_data != NULL)
 		purple_network_listen_cancel(jsx->listen_data);
+	if (jsx->iq_id != NULL)
+		jabber_iq_remove_callback_by_id(js, jsx->iq_id);
 
 	g_free(jsx->stream_id);
 	g_free(jsx->iq_id);