aboutsummaryrefslogtreecommitdiff
path: root/plugins/http-files/src/file_sender.vala
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/http-files/src/file_sender.vala')
-rw-r--r--plugins/http-files/src/file_sender.vala5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/http-files/src/file_sender.vala b/plugins/http-files/src/file_sender.vala
index a39d695b..957611d0 100644
--- a/plugins/http-files/src/file_sender.vala
+++ b/plugins/http-files/src/file_sender.vala
@@ -7,12 +7,15 @@ namespace Dino.Plugins.HttpFiles {
public class HttpFileSender : FileSender, Object {
private StreamInteractor stream_interactor;
private Database db;
+ private Soup.Session session;
private HashMap<Account, long> max_file_sizes = new HashMap<Account, long>(Account.hash_func, Account.equals_func);
public HttpFileSender(StreamInteractor stream_interactor, Database db) {
this.stream_interactor = stream_interactor;
this.db = db;
+ this.session = new Soup.Session();
+ session.user_agent = @"Dino/$(Dino.get_short_version()) ";
stream_interactor.stream_negotiated.connect(on_stream_negotiated);
stream_interactor.get_module(MessageProcessor.IDENTITY).build_message_stanza.connect(check_add_oob);
}
@@ -90,8 +93,6 @@ public class HttpFileSender : FileSender, Object {
Xmpp.XmppStream? stream = stream_interactor.get_stream(file_transfer.account);
if (stream == null) return;
- var session = new Soup.Session();
- session.user_agent = @"Dino/$(Dino.get_short_version()) ";
var put_message = new Soup.Message("PUT", file_send_data.url_up);
#if SOUP_3_0
put_message.set_request_body(file_meta.mime_type, file_transfer.input_stream, (ssize_t) file_meta.size);