MUC: Fixed: Unavilable presence was not being broadcasted for banned users in some...
[prosody.git] / plugins / mod_version.lua
index a34ce6f26dfc91dda958e3d5202a57c6285855ff..f3c5c1903376e5663a5b0bcdeb673a83e06ff147 100644 (file)
@@ -12,6 +12,10 @@ module:add_feature("jabber:iq:version");
 
 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 @@ if not module:get_option("hide_os_type") then
                        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