aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-16 20:46:06 +0100
committerKim Alvefur <zash@zash.se>2017-03-16 20:46:06 +0100
commitc3d7d52f0df686f7cfd5ee6c6474edf6e206c5c0 (patch)
tree3eb037d679778fc3effcf9e0c850e8b6b781b032
parent0bf98e614f8ce41994280fabf07738c5c22404bf (diff)
downloadprosody-c3d7d52f0df686f7cfd5ee6c6474edf6e206c5c0.tar.gz
prosody-c3d7d52f0df686f7cfd5ee6c6474edf6e206c5c0.zip
plugins/various: Use type-specific config API
-rw-r--r--plugins/mod_admin_telnet.lua4
-rw-r--r--plugins/mod_disco.lua2
-rw-r--r--plugins/mod_http_files.lua2
-rw-r--r--plugins/mod_version.lua4
4 files changed, 6 insertions, 6 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index b24adcf9..04e93d7e 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -1111,7 +1111,7 @@ function def_env.http:list()
for host in pairs(prosody.hosts) do
local http_apps = modulemanager.get_items("http-provider", host);
if #http_apps > 0 then
- local http_host = module:context(host):get_option("http_host");
+ local http_host = module:context(host):get_option_string("http_host");
print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":"));
for _, provider in ipairs(http_apps) do
local url = module:context(host):http_url(provider.name);
@@ -1121,7 +1121,7 @@ function def_env.http:list()
end
end
- local default_host = module:get_option("http_default_host");
+ local default_host = module:get_option_string("http_default_host");
if not default_host then
print("HTTP requests to unknown hosts will return 404 Not Found");
else
diff --git a/plugins/mod_disco.lua b/plugins/mod_disco.lua
index c9d4a9df..517fcaec 100644
--- a/plugins/mod_disco.lua
+++ b/plugins/mod_disco.lua
@@ -13,7 +13,7 @@ local jid_bare = require "util.jid".bare;
local st = require "util.stanza"
local calculate_hash = require "util.caps".calculate_hash;
-local disco_items = module:get_option("disco_items") or {};
+local disco_items = module:get_option_array("disco_items", {})
do -- validate disco_items
for _, item in ipairs(disco_items) do
local err;
diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua
index ab2f3966..7735cfbb 100644
--- a/plugins/mod_http_files.lua
+++ b/plugins/mod_http_files.lua
@@ -19,7 +19,7 @@ local path_sep = package.config:sub(1,1);
local base_path = module:get_option_string("http_files_dir", module:get_option_string("http_path"));
local cache_size = module:get_option_number("http_files_cache_size", 128);
local cache_max_file_size = module:get_option_number("http_files_cache_max_file_size", 4096);
-local dir_indices = module:get_option("http_index_files", { "index.html", "index.htm" });
+local dir_indices = module:get_option_array("http_index_files", { "index.html", "index.htm" });
local directory_index = module:get_option_boolean("http_dir_listing");
local mime_map = module:shared("/*/http_files/mime").types;
diff --git a/plugins/mod_version.lua b/plugins/mod_version.lua
index be244beb..7f045415 100644
--- a/plugins/mod_version.lua
+++ b/plugins/mod_version.lua
@@ -16,11 +16,11 @@ local query = st.stanza("query", {xmlns = "jabber:iq:version"})
:tag("name"):text("Prosody"):up()
:tag("version"):text(prosody.version):up();
-if not module:get_option("hide_os_type") then
+if not module:get_option_boolean("hide_os_type") then
if os.getenv("WINDIR") then
version = "Windows";
else
- local os_version_command = module:get_option("os_version_command");
+ local os_version_command = module:get_option_string("os_version_command");
local ok, pposix = pcall(require, "util.pposix");
if not os_version_command and (ok and pposix and pposix.uname) then
version = pposix.uname().sysname;