aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-16 23:49:27 +0100
committerKim Alvefur <zash@zash.se>2017-03-16 23:49:27 +0100
commit3601968ff85a10f18f1dba92360aac7efabe09ad (patch)
tree5d9e9dfec7020f862dc40a4b872556e3661b5327 /plugins
parent33f73b5b885da18cef1b983cd1a1fe6d287e0391 (diff)
parent4ce8edd6eb83eff68970077e9c3c99df19f5a955 (diff)
downloadprosody-3601968ff85a10f18f1dba92360aac7efabe09ad.tar.gz
prosody-3601968ff85a10f18f1dba92360aac7efabe09ad.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_telnet.lua4
-rw-r--r--plugins/mod_disco.lua2
-rw-r--r--plugins/mod_http_files.lua4
-rw-r--r--plugins/mod_mam/mamprefs.lib.lua5
-rw-r--r--plugins/mod_mam/mod_mam.lua2
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua3
-rw-r--r--plugins/mod_version.lua4
7 files changed, 13 insertions, 11 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 0913eb6d..2f5d9f63 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -1148,7 +1148,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);
@@ -1158,7 +1158,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..e396df60 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;
@@ -37,7 +37,7 @@ if not mime_map then
};
module:shared("/*/http_files/mime").types = mime_map;
- local mime_types, err = open(module:get_option_string("mime_types_file", "/etc/mime.types"),"r");
+ local mime_types, err = open(module:get_option_path("mime_types_file", "/etc/mime.types", prosody.paths.config), "r");
if mime_types then
local mime_data = mime_types:read("*a");
mime_types:close();
diff --git a/plugins/mod_mam/mamprefs.lib.lua b/plugins/mod_mam/mamprefs.lib.lua
index a561b9d5..72c08886 100644
--- a/plugins/mod_mam/mamprefs.lib.lua
+++ b/plugins/mod_mam/mamprefs.lib.lua
@@ -10,7 +10,10 @@
--
-- luacheck: ignore 122/prosody
-local global_default_policy = module:get_option("default_archive_policy", true);
+local global_default_policy = module:get_option_string("default_archive_policy", true);
+if global_default_policy ~= "roster" then
+ global_default_policy = module:get_option_boolean("default_archive_policy", global_default_policy);
+end
do
-- luacheck: ignore 211/prefs_format
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index 6e6d6383..7ea14502 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -35,7 +35,7 @@ local time_now = os.time;
local m_min = math.min;
local timestamp, timestamp_parse = require "util.datetime".datetime, require "util.datetime".parse;
local default_max_items, max_max_items = 20, module:get_option_number("max_archive_query_results", 50);
-local global_default_policy = module:get_option("default_archive_policy", true);
+local global_default_policy = module:get_option_string("default_archive_policy", true);
if global_default_policy ~= "roster" then
global_default_policy = module:get_option_boolean("default_archive_policy", global_default_policy);
end
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index 2b878ed8..18d85c52 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -9,8 +9,7 @@ local xmlns_pubsub_owner = "http://jabber.org/protocol/pubsub#owner";
local autocreate_on_publish = module:get_option_boolean("autocreate_on_publish", false);
local autocreate_on_subscribe = module:get_option_boolean("autocreate_on_subscribe", false);
-local pubsub_disco_name = module:get_option("name");
-if type(pubsub_disco_name) ~= "string" then pubsub_disco_name = "Prosody PubSub Service"; end
+local pubsub_disco_name = module:get_option_string("name" "Prosody PubSub Service");
local expose_publisher = module:get_option_boolean("expose_publisher", false)
local service;
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;