aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-08-21 12:08:35 +0200
committersteckbrief <steckbrief@chefmail.de>2016-08-21 12:08:35 +0200
commit15090fe1bede4e1ad5672c6a645db1a56a777610 (patch)
treef4b4af232c70ee233fffcab50320c3baa79ed06b
parent25e8420fdb2e80a41e3e73af9983302ffccb2ba0 (diff)
fixed wrong reqbody for delete, added explicit slot_type also for upload request, variable misspelling corrected
-rw-r--r--prosody-module/mod_http_upload_external/mod_http_upload_external.lua6
1 files changed, 3 insertions, 3 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 757a59c..335a9d1 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
@@ -59,7 +59,7 @@ module:hook("iq/host/"..xmlns_http_upload..":request", function (event)
local content_type = request:get_child_text("content-type");
-- build the body
- local reqbody = "xmpp_server_key=" .. xmpp_server_key .. "&size=" .. filesize .. "&filename=" .. filename .. "&user_jid=" .. orig_from;
+ local reqbody = "xmpp_server_key=" .. xmpp_server_key .. "&slot_type=upload&size=" .. filesize .. "&filename=" .. filename .. "&user_jid=" .. orig_from;
if content_type then
reqbody = reqbody .. "&content_type=" .. content_type;
end
@@ -142,7 +142,7 @@ module:hook("iq/host/"..xmlns_http_upload..":request", function (event)
return true;
end
-- build the body
- local reqbody = "xmpp_server_key=" .. xmpp_server_key .. "&size=" .. filesize .. "&filename=" .. filename .. "&user_jid=" .. orig_from;
+ local reqbody = "xmpp_server_key=" .. xmpp_server_key .. "slot_type=delete&file_url=" .. fileurl .. "&user_jid=" .. orig_from;
-- the request
local respbody, statuscode = http.request(external_url, reqbody);
respbody = string.gsub(respbody, "\\/", "/")
@@ -194,7 +194,7 @@ module:hook("iq/host/"..xmlns_http_upload..":request", function (event)
local reply = st.reply(stanza);
reply:tag("slot", { xmlns = xmlns_http_upload });
- reply:tag("deletetoken"):text(deletetoken):up();
+ reply:tag("deletetoken"):text(delete_token):up();
origin.send(reply);
else
origin.send(st.error_reply(stanza, "cancel", "undefined-condition", "status code: " .. statuscode .. " response: " ..respbody));