diff options
author | fiaxh <git@mx.ax.lt> | 2017-08-09 00:08:52 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-08-09 00:12:15 +0200 |
commit | e3e6a426f486ddef3c3ed299e30d8de3507b79a2 (patch) | |
tree | 49c707c14fde4a1ef5e224b8ac3d966b9f0cc598 | |
parent | 0206139f0f8a472e6ac63fd0d303b215c88746e2 (diff) | |
download | dino-e3e6a426f486ddef3c3ed299e30d8de3507b79a2.tar.gz dino-e3e6a426f486ddef3c3ed299e30d8de3507b79a2.zip |
http files: Fix for servers w/o file size limit
-rw-r--r-- | plugins/http-files/src/upload_stream_module.vala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/http-files/src/upload_stream_module.vala b/plugins/http-files/src/upload_stream_module.vala index c427f7b8..cb105cee 100644 --- a/plugins/http-files/src/upload_stream_module.vala +++ b/plugins/http-files/src/upload_stream_module.vala @@ -15,7 +15,6 @@ public class UploadStreamModule : XmppStreamModule { public delegate void OnUploadOk(XmppStream stream, string url_down); public delegate void OnError(XmppStream stream, string error); public void upload(XmppStream stream, string file_uri, owned OnUploadOk listener, owned OnError error_listener) { - print("up!\n"); File file = File.new_for_path(file_uri); FileInfo file_info = file.query_info("*", FileQueryInfoFlags.NONE); request_slot(stream, file.get_basename(), (int)file_info.get_size(), file_info.get_content_type(), @@ -143,10 +142,11 @@ public class UploadStreamModule : XmppStreamModule { if (var_attr == "max-file-size") { StanzaNode value_node = node.get_subnode("value", "jabber:x:data"); max_file_size_str = value_node.get_string_content(); - break; + break; } } - return max_file_size_str != null ? int.parse(max_file_size_str) : (int?) null; + if (max_file_size_str != null) return int.parse(max_file_size_str); + return null; } } |