mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 13:47:41 +03:00
mod_server_contact_info: Generate properly escaped URIs from 'admins'
This commit is contained in:
parent
a87492d53c
commit
59cae27ea2
1 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
local array = require "util.array";
|
local array = require "util.array";
|
||||||
local jid = require "util.jid";
|
local jid = require "util.jid";
|
||||||
|
local url = require "socket.url";
|
||||||
|
|
||||||
-- Source: http://xmpp.org/registrar/formtypes.html#http:--jabber.org-network-serverinfo
|
-- Source: http://xmpp.org/registrar/formtypes.html#http:--jabber.org-network-serverinfo
|
||||||
local form_layout = require "util.dataforms".new({
|
local form_layout = require "util.dataforms".new({
|
||||||
|
@ -25,7 +26,7 @@ local form_layout = require "util.dataforms".new({
|
||||||
local admins = module:get_option_inherited_set("admins", {});
|
local admins = module:get_option_inherited_set("admins", {});
|
||||||
|
|
||||||
local contact_config = module:get_option("contact_info", {
|
local contact_config = module:get_option("contact_info", {
|
||||||
admin = array.collect( admins / jid.prep / function(admin) return "xmpp:" .. admin; end);
|
admin = array.collect(admins / jid.prep / function(admin) return url.build({scheme = "xmpp"; path = admin}); end);
|
||||||
});
|
});
|
||||||
|
|
||||||
module:add_extension(form_layout:form(contact_config, "result"));
|
module:add_extension(form_layout:form(contact_config, "result"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue