plugins/mod_version.lua
changeset 9439 a950f9fa9137
parent 9438 33301038d3e4
child 12981 74b9e05af71e
equal deleted inserted replaced
9438:33301038d3e4 9439: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");