aboutsummaryrefslogtreecommitdiffstats
path: root/prosody-module/mod_http_upload_external
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2017-05-02 20:59:08 +0200
committersteckbrief <steckbrief@chefmail.de>2017-05-02 20:59:08 +0200
commit9cd578978fcb4fbd8d656afa96280a6f53c5b035 (patch)
treee12c35b9c517ba3801f6c8c19a24ff49646891a7 /prosody-module/mod_http_upload_external
parent471b217ceb7bcf4a1db5eb3f825bb09b5f8d8345 (diff)
add additional disco info to advertise managing UI
Diffstat (limited to 'prosody-module/mod_http_upload_external')
-rw-r--r--prosody-module/mod_http_upload_external/mod_http_upload_external.lua8
1 files changed, 8 insertions, 0 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 23e356e..f88b29c 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
@@ -12,11 +12,13 @@
-- configuration
local external_url = module:get_option("http_upload_external_url");
local xmpp_server_key = module:get_option("http_upload_external_server_key");
+local filetransfer_manager_ui_url = module:get_option("filetransfer_manager_ui_url");
-- imports
local st = require"util.stanza";
local http = require"socket.http";
local json = require"util.json";
+local dataform = require "util.dataforms".new;
-- depends
module:depends("disco");
@@ -26,6 +28,12 @@ local xmlns_http_upload = "urn:xmpp:filetransfer:http";
module:add_feature(xmlns_http_upload);
+-- add additional disco info to advertise managing UI
+module:add_extension(dataform {
+ { name = "FORM_TYPE", type = "hidden", value = xmlns_http_upload },
+ { name = "filetransfer-manager-ui-url", type = "text-single" },
+}:form({ ["filetransfer-manager-ui-url"] = filetransfer_manager_ui_url }, "result"));
+
-- hooks
module:hook("iq/host/"..xmlns_http_upload..":request", function (event)
local stanza, origin = event.stanza, event.origin;