Comparison

plugins/mod_version.lua @ 9436:a950f9fa9137

mod_version: Reduce scope of variable It is only used in this if block anyways
author Kim Alvefur <zash@zash.se>
date Sat, 06 Oct 2018 16:38:05 +0200
parent 9435:33301038d3e4
child 12977:74b9e05af71e
comparison
equal deleted inserted replaced
9435:33301038d3e4 9436:a950f9fa9137
8 8
9 local st = require "util.stanza"; 9 local st = require "util.stanza";
10 10
11 module:add_feature("jabber:iq:version"); 11 module:add_feature("jabber:iq:version");
12 12
13 local platform;
14
15 local query = st.stanza("query", {xmlns = "jabber:iq:version"}) 13 local query = st.stanza("query", {xmlns = "jabber:iq:version"})
16 :text_tag("name", "Prosody") 14 :text_tag("name", "Prosody")
17 :text_tag("version", prosody.version); 15 :text_tag("version", prosody.version);
18 16
19 if not module:get_option_boolean("hide_os_type") then 17 if not module:get_option_boolean("hide_os_type") then
18 local platform;
20 if os.getenv("WINDIR") then 19 if os.getenv("WINDIR") then
21 platform = "Windows"; 20 platform = "Windows";
22 else 21 else
23 local os_version_command = module:get_option_string("os_version_command"); 22 local os_version_command = module:get_option_string("os_version_command");
24 local ok, pposix = pcall(require, "util.pposix"); 23 local ok, pposix = pcall(require, "util.pposix");