diff options
author | Tobias Markmann <tm@ayena.de> | 2015-06-20 12:20:41 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-07-08 07:08:40 (GMT) |
commit | 5c55a79de95c11cecc0c98b57dfa1ff81ec7fb95 (patch) | |
tree | 1d8e52cd829f3b622b54734e17366d7e72d8bdba /Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp | |
parent | 67fef39ed463533157e66a72c17f31f9d078d5a2 (diff) | |
download | swift-5c55a79de95c11cecc0c98b57dfa1ff81ec7fb95.zip swift-5c55a79de95c11cecc0c98b57dfa1ff81ec7fb95.tar.bz2 |
Show canceled file-transfer by other party as canceled and not failed
Test-Information:
Added unit test that checks for the expected behavior.
Change-Id: I4079bdc1182af466eedd2496b9837e024f14acb2
Diffstat (limited to 'Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp')
-rw-r--r-- | Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp index 5c18b13..f9441cd 100644 --- a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp +++ b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp @@ -136,9 +136,12 @@ void OutgoingJingleFileTransfer::handleSessionTerminateReceived(boost::optional< if (reason && reason->type == JinglePayload::Reason::Cancel) { setFinishedState(FileTransfer::State::Canceled, FileTransferError(FileTransferError::PeerError)); } + else if (reason && reason->type == JinglePayload::Reason::Decline) { + setFinishedState(FileTransfer::State::Canceled, boost::optional<FileTransferError>()); + } else if (reason && reason->type == JinglePayload::Reason::Success) { setFinishedState(FileTransfer::State::Finished, boost::optional<FileTransferError>()); - } + } else { setFinishedState(FileTransfer::State::Failed, FileTransferError(FileTransferError::PeerError)); } @@ -190,6 +193,7 @@ void OutgoingJingleFileTransfer::handleLocalTransportCandidatesGenerated( transport->setDstAddr(dstAddr); foreach(JingleS5BTransportPayload::Candidate candidate, candidates) { transport->addCandidate(candidate); + SWIFT_LOG(debug) << "\t" << "S5B candidate: " << candidate.hostPort.toString() << std::endl; } setState(WaitingForAccept); session->sendInitiate(contentID, description, transport); |