summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer')
-rw-r--r--Swiften/FileTransfer/FileTransfer.cpp3
-rw-r--r--Swiften/FileTransfer/FileTransfer.h7
-rw-r--r--Swiften/FileTransfer/IncomingJingleFileTransfer.cpp2
-rw-r--r--Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp2
4 files changed, 10 insertions, 4 deletions
diff --git a/Swiften/FileTransfer/FileTransfer.cpp b/Swiften/FileTransfer/FileTransfer.cpp
index f63a4e8..4782d39 100644
--- a/Swiften/FileTransfer/FileTransfer.cpp
+++ b/Swiften/FileTransfer/FileTransfer.cpp
@@ -19,7 +19,8 @@ void FileTransfer::setState(const State& state) {
onStateChanged(state);
}
-void FileTransfer::setFileInfo(const std::string& name, boost::uintmax_t size) {
+void FileTransfer::setFileInfo(const std::string& name, boost::uintmax_t size, const std::string& description) {
filename_ = name;
fileSizeInBytes_ = size;
+ description_ = description;
}
diff --git a/Swiften/FileTransfer/FileTransfer.h b/Swiften/FileTransfer/FileTransfer.h
index afb3f7b..ab8e806 100644
--- a/Swiften/FileTransfer/FileTransfer.h
+++ b/Swiften/FileTransfer/FileTransfer.h
@@ -66,6 +66,10 @@ namespace Swift {
return state_;
}
+ const std::string& getDescription() const {
+ return description_;
+ }
+
public:
boost::signal<void (size_t /* proccessedBytes */)> onProcessedBytes;
boost::signal<void (const State&)> onStateChanged;
@@ -73,11 +77,12 @@ namespace Swift {
protected:
void setState(const State& state);
- void setFileInfo(const std::string& name, boost::uintmax_t size);
+ void setFileInfo(const std::string& name, boost::uintmax_t size, const std::string& description);
private:
boost::uintmax_t fileSizeInBytes_;
std::string filename_;
+ std::string description_;
State state_;
};
}
diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
index 39da46f..01bed78 100644
--- a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
@@ -47,7 +47,7 @@ IncomingJingleFileTransfer::IncomingJingleFileTransfer(
description = initialContent->getDescription<JingleFileTransferDescription>();
assert(description);
JingleFileTransferFileInfo fileInfo = description->getFileInfo();
- setFileInfo(fileInfo.getName(), fileInfo.getSize());
+ setFileInfo(fileInfo.getName(), fileInfo.getSize(), fileInfo.getDescription());
hashes = fileInfo.getHashes();
waitOnHashTimer = timerFactory->createTimer(5000);
diff --git a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
index 6369581..b8e848c 100644
--- a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
@@ -62,7 +62,7 @@ OutgoingJingleFileTransfer::OutgoingJingleFileTransfer(
state(Initial),
candidateAcknowledged(false) {
- setFileInfo(fileInfo.getName(), fileInfo.getSize());
+ setFileInfo(fileInfo.getName(), fileInfo.getSize(), fileInfo.getDescription());
// calculate both, MD5 and SHA-1 since we don't know which one the other side supports
hashCalculator = new IncrementalBytestreamHashCalculator(true, true, crypto);