From 5eb89338458575933798c9fdf436029e9f842493 Mon Sep 17 00:00:00 2001 From: lookshe Date: Mon, 4 Jan 2016 23:50:04 +0100 Subject: correct indention --- .../mod_http_upload_external.lua | 58 +++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua index 6900483..9aa0f7c 100644 --- a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua +++ b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua @@ -29,30 +29,30 @@ module:add_feature(xmlns_http_upload); -- hooks module:hook("iq/host/"..xmlns_http_upload..":request", function (event) - local stanza, origin = event.stanza, event.origin; + local stanza, origin = event.stanza, event.origin; local orig_from = stanza.attr.from; - local request = stanza.tags[1]; - -- local clients only - if origin.type ~= "c2s" then - origin.send(st.error_reply(stanza, "cancel", "not-authorized")); - return true; - end - -- validate - local filename = request:get_child_text("filename"); - if not filename then - origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid filename")); - return true; - end - local filesize = tonumber(request:get_child_text("size")); - if not filesize then - origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing or invalid file size")); - return true; - elseif filesize > file_size_limit then - origin.send(st.error_reply(stanza, "modify", "not-acceptable", "File too large", - st.stanza("file-too-large", {xmlns=xmlns_http_upload}) - :tag("max-size"):text(tostring(file_size_limit)))); - return true; - end + local request = stanza.tags[1]; + -- local clients only + if origin.type ~= "c2s" then + origin.send(st.error_reply(stanza, "cancel", "not-authorized")); + return true; + end + -- validate + local filename = request:get_child_text("filename"); + if not filename then + origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid filename")); + return true; + end + local filesize = tonumber(request:get_child_text("size")); + if not filesize then + origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing or invalid file size")); + return true; + elseif filesize > file_size_limit then + origin.send(st.error_reply(stanza, "modify", "not-acceptable", "File too large", + st.stanza("file-too-large", {xmlns=xmlns_http_upload}) + :tag("max-size"):text(tostring(file_size_limit)))); + return true; + end local content_type = request:get_child_text("content-type"); @@ -125,10 +125,10 @@ module:hook("iq/host/"..xmlns_http_upload..":request", function (event) return true; end - local reply = st.reply(stanza); - reply:tag("slot", { xmlns = xmlns_http_upload }); - reply:tag("get"):text(get_url):up(); - reply:tag("put"):text(put_url):up(); - origin.send(reply); - return true; + local reply = st.reply(stanza); + reply:tag("slot", { xmlns = xmlns_http_upload }); + reply:tag("get"):text(get_url):up(); + reply:tag("put"):text(put_url):up(); + origin.send(reply); + return true; end); -- cgit v1.2.3