-local function handle_version_request(session, stanza)
- if stanza.attr.type == "get" then
- session.send(st.reply(stanza):query(xmlns_version)
- :tag("name"):text("Prosody"):up()
- :tag("version"):text("0.1"):up()
- :tag("os"):text("the best operating system ever!"));
+if not module:get_option("hide_os_type") then
+ if os.getenv("WINDIR") then
+ version = "Windows";
+ else
+ local uname = io.popen(module:get_option("os_version_command") or "uname");
+ if uname then
+ version = uname:read("*a");
+ else
+ version = "an OS";
+ end