pidgin: 6ef47607: Set file transfers to "completed" if the...

markdoliner at pidgin.im markdoliner at pidgin.im
Tue Apr 6 04:22:43 EDT 2010


-----------------------------------------------------------------
Revision: 6ef47607acf2deca68a194f9a43e42729b07a273
Ancestor: 3675047f72f66174d95018d40a0100ea0bc87f8c
Author: markdoliner at pidgin.im
Date: 2010-04-06T08:18:47
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/6ef47607acf2deca68a194f9a43e42729b07a273

Modified files:
        libpurple/protocols/oscar/oft.c
        libpurple/protocols/oscar/peer.h

ChangeLog: 

Set file transfers to "completed" if the other user tells us they've
received the file.  Fixes a bug where we show the file transfer as
canceled by us in the event where we're sending them a file that they
already have.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oft.c	d95852f3ed01a8df958bc387bc1d46e5cf181232
+++ libpurple/protocols/oscar/oft.c	1db020882cc23be21e41f276ee91551c41dd3305
@@ -496,6 +496,15 @@ peer_oft_recv_frame_done(PeerConnection 
 static void
 peer_oft_recv_frame_done(PeerConnection *conn, OftFrame *frame)
 {
+	/*
+	 * The core ft code sets the xfer to completed automatically if we've
+	 * sent all bytes to the other user.  But this function can be called
+	 * even if we haven't sent all bytes to the other user (in the case
+	 * where the user already has this file on their computer and the
+	 * checksum matches).
+	 */
+	purple_xfer_set_completed(conn->xfer, TRUE);
+
 	purple_input_remove(conn->watcher_incoming);
 	conn->watcher_incoming = 0;
 	conn->xfer->fd = conn->fd;
============================================================
--- libpurple/protocols/oscar/peer.h	2953b14dd960a8c523f84d501c70e643cdb9487a
+++ libpurple/protocols/oscar/peer.h	3735dbc4a4e79c10135bb2ded024349b848e112c
@@ -45,7 +45,7 @@ typedef struct _PeerConnection        Pe
 #define PEER_TYPE_PROMPT 0x0101 /* "I am going to send you this file, is that ok?" */
 #define PEER_TYPE_RESUMEACCEPT 0x0106 /* We are accepting the resume */
 #define PEER_TYPE_ACK 0x0202 /* "Yes, it is ok for you to send me that file" */
-#define PEER_TYPE_DONE 0x0204 /* "I received that file with no problems, thanks a bunch" */
+#define PEER_TYPE_DONE 0x0204 /* "I received that file with no problems" or "I already have that file, great!" */
 #define PEER_TYPE_RESUME 0x0205 /* Resume transferring, sent by whoever receives */
 #define PEER_TYPE_RESUMEACK 0x0207 /* Our resume accept was ACKed */
 


More information about the Commits mailing list