aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_compression.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-01-19 16:38:04 +0100
committerKim Alvefur <zash@zash.se>2012-01-19 16:38:04 +0100
commitdabccd65ac4cf3da3b241434d83e026df5d5bfdc (patch)
treefb826f0fa3835fe27f3a04ecbe45de8e083e0ffc /plugins/mod_compression.lua
parent78d03688b9aa6c56951a653e9a97857fb6c2c928 (diff)
downloadprosody-dabccd65ac4cf3da3b241434d83e026df5d5bfdc.tar.gz
prosody-dabccd65ac4cf3da3b241434d83e026df5d5bfdc.zip
mod_compression: Use get_option_number
Diffstat (limited to 'plugins/mod_compression.lua')
-rw-r--r--plugins/mod_compression.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua
index 82403016..b5031d72 100644
--- a/plugins/mod_compression.lua
+++ b/plugins/mod_compression.lua
@@ -16,12 +16,8 @@ local xmlns_stream = "http://etherx.jabber.org/streams";
local compression_stream_feature = st.stanza("compression", {xmlns=xmlns_compression_feature}):tag("method"):text("zlib"):up();
local add_filter = require "util.filters".add_filter;
-local compression_level = module:get_option("compression_level");
--- if not defined assume admin wants best compression
-if compression_level == nil then compression_level = 9 end;
+local compression_level = module:get_option_number("compression_level", 9);
-
-compression_level = tonumber(compression_level);
if not compression_level or compression_level < 1 or compression_level > 9 then
module:log("warn", "Invalid compression level in config: %s", tostring(compression_level));
module:log("warn", "Module loading aborted. Compression won't be available.");