cpw.malu.xmpp.jingle_ft: 81e3c766: Send session terminate when rejecting a ...

malu at pidgin.im malu at pidgin.im
Mon Jan 25 16:31:00 EST 2010


-----------------------------------------------------------------
Revision: 81e3c7668c28d1aeff5843eed94913fb6313f80e
Ancestor: d5d0e39cb3981e294581d66ea031f2ea7fcd313d
Author: malu at pidgin.im
Date: 2010-01-25T21:26:17
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/81e3c7668c28d1aeff5843eed94913fb6313f80e

Modified files:
        libpurple/protocols/jabber/jingle/file-transfer.c

ChangeLog: 

Send session terminate when rejecting a file transfer offer (with reason "decline").

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/file-transfer.c	349956636c785a3f636fda1051cd6ac552cb6623
+++ libpurple/protocols/jabber/jingle/file-transfer.c	8b810a734def5835c02705158cbbfe94e7060f53
@@ -574,6 +574,20 @@ static void
 }
 
 static void
+jingle_file_transfer_request_denied(PurpleXfer *xfer)
+{
+	JingleContent *content = (JingleContent *) xfer->data;
+	JingleSession *session = jingle_content_get_session(content);
+
+	if (session) {
+		jabber_iq_send(jingle_session_terminate_packet(session, "decline"));
+		g_object_unref(session);
+		g_object_unref(session);
+	}
+	xfer->data = NULL;
+}
+
+static void
 jingle_file_transfer_terminate_cb(JabberStream *js, const char *from,
                                 JabberIqType type, const char *id,
                                 xmlnode *packet, gpointer data)
@@ -723,6 +737,8 @@ jingle_file_transfer_handle_action_inter
 						jingle_file_transfer_xfer_end);
 					purple_xfer_set_cancel_recv_fnc(xfer,
 						jingle_file_transfer_cancel_recv);
+					purple_xfer_set_request_denied_fnc(xfer,
+					    jingle_file_transfer_request_denied);
 					purple_xfer_request(xfer);
 				} else {
 					/* TODO: set a reason code */


More information about the Commits mailing list