--- a/plugins/mod_version.lua Sun Aug 01 15:56:52 2010 +0200
+++ b/plugins/mod_version.lua Sun Aug 01 15:58:10 2010 +0200
@@ -12,6 +12,10 @@
local version = "the best operating system ever!";
+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 os.getenv("WINDIR") then
version = "Windows";
@@ -23,15 +27,10 @@
version = "an OS";
end
end
+ version = version:match("^%s*(.-)%s*$") or version;
+ query:tag("os"):text(version):up();
end
-version = version:match("^%s*(.-)%s*$") or version;
-
-local query = st.stanza("query", {xmlns = "jabber:iq:version"})
- :tag("name"):text("Prosody"):up()
- :tag("version"):text(prosody.version):up()
- :tag("os"):text(version);
-
module:hook("iq/host/jabber:iq:version:query", function(event)
local stanza = event.stanza;
if stanza.attr.type == "get" and stanza.attr.to == module.host then