diff libpurple/protocols/oscar/oft.c @ 30096:0869bfe2738f

merged with im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 07 Apr 2010 17:41:51 +0900
parents d8e6a2d592a4 c726b1461159
children c5ba7dd399fa
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oft.c	Wed Apr 07 17:41:12 2010 +0900
+++ b/libpurple/protocols/oscar/oft.c	Wed Apr 07 17:41:51 2010 +0900
@@ -496,6 +496,16 @@
 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).
+	 */
+	if (!purple_xfer_is_completed(conn->xfer))
+		purple_xfer_set_completed(conn->xfer, TRUE);
+
 	purple_input_remove(conn->watcher_incoming);
 	conn->watcher_incoming = 0;
 	conn->xfer->fd = conn->fd;