aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/jingle_file_transfers.vala
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/service/jingle_file_transfers.vala')
-rw-r--r--libdino/src/service/jingle_file_transfers.vala12
1 files changed, 4 insertions, 8 deletions
diff --git a/libdino/src/service/jingle_file_transfers.vala b/libdino/src/service/jingle_file_transfers.vala
index daccd309..e0d3fce1 100644
--- a/libdino/src/service/jingle_file_transfers.vala
+++ b/libdino/src/service/jingle_file_transfers.vala
@@ -74,7 +74,7 @@ public class JingleFileProvider : FileProvider, Object {
return file_meta;
}
- public async FileReceiveData? get_file_receive_data(FileTransfer file_transfer) {
+ public FileReceiveData? get_file_receive_data(FileTransfer file_transfer) {
return new FileReceiveData();
}
@@ -95,18 +95,14 @@ public class JingleFileProvider : FileProvider, Object {
return Encryption.NONE;
}
- public async InputStream download(FileTransfer file_transfer, FileReceiveData receive_data, FileMeta file_meta) throws FileReceiveError {
+ public async InputStream download(FileTransfer file_transfer, FileReceiveData receive_data, FileMeta file_meta) throws IOError {
// TODO(hrxi) What should happen if `stream == null`?
XmppStream? stream = stream_interactor.get_stream(file_transfer.account);
Xmpp.Xep.JingleFileTransfer.FileTransfer? jingle_file_transfer = file_transfers[file_transfer.info];
if (jingle_file_transfer == null) {
- throw new FileReceiveError.DOWNLOAD_FAILED("Transfer data not available anymore");
- }
- try {
- yield jingle_file_transfer.accept(stream);
- } catch (IOError e) {
- throw new FileReceiveError.DOWNLOAD_FAILED("Establishing connection did not work");
+ throw new IOError.FAILED("Transfer data not available anymore");
}
+ yield jingle_file_transfer.accept(stream);
return jingle_file_transfer.stream;
}