# HG changeset patch # User Mark Doliner # Date 1270541927 0 # Node ID 1d657e98667b40630b13715ea50aa6ca51dd6481 # Parent 29df7408df03c17713c12ab144bd631fe04ef39b 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. diff -r 29df7408df03 -r 1d657e98667b libpurple/protocols/oscar/oft.c --- a/libpurple/protocols/oscar/oft.c Sun Apr 04 04:31:54 2010 +0000 +++ b/libpurple/protocols/oscar/oft.c Tue Apr 06 08:18:47 2010 +0000 @@ -496,6 +496,15 @@ 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; diff -r 29df7408df03 -r 1d657e98667b libpurple/protocols/oscar/peer.h --- a/libpurple/protocols/oscar/peer.h Sun Apr 04 04:31:54 2010 +0000 +++ b/libpurple/protocols/oscar/peer.h Tue Apr 06 08:18:47 2010 +0000 @@ -45,7 +45,7 @@ #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 */