aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_version.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_version.lua')
-rw-r--r--plugins/mod_version.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/mod_version.lua b/plugins/mod_version.lua
index a34ce6f2..f3c5c190 100644
--- a/plugins/mod_version.lua
+++ b/plugins/mod_version.lua
@@ -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