Mercurial > prosody-hg
comparison plugins/mod_version.lua @ 12977:74b9e05af71e
plugins: Prefix module imports with prosody namespace
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 24 Mar 2023 13:15:28 +0100 |
| parents | a950f9fa9137 |
| children | 05c1098084cd |
comparison
equal
deleted
inserted
replaced
| 12976:a187600ec7d6 | 12977:74b9e05af71e |
|---|---|
| 4 -- | 4 -- |
| 5 -- This project is MIT/X11 licensed. Please see the | 5 -- This project is MIT/X11 licensed. Please see the |
| 6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
| 7 -- | 7 -- |
| 8 | 8 |
| 9 local st = require "util.stanza"; | 9 local st = require "prosody.util.stanza"; |
| 10 | 10 |
| 11 module:add_feature("jabber:iq:version"); | 11 module:add_feature("jabber:iq:version"); |
| 12 | 12 |
| 13 local query = st.stanza("query", {xmlns = "jabber:iq:version"}) | 13 local query = st.stanza("query", {xmlns = "jabber:iq:version"}) |
| 14 :text_tag("name", "Prosody") | 14 :text_tag("name", "Prosody") |
| 18 local platform; | 18 local platform; |
| 19 if os.getenv("WINDIR") then | 19 if os.getenv("WINDIR") then |
| 20 platform = "Windows"; | 20 platform = "Windows"; |
| 21 else | 21 else |
| 22 local os_version_command = module:get_option_string("os_version_command"); | 22 local os_version_command = module:get_option_string("os_version_command"); |
| 23 local ok, pposix = pcall(require, "util.pposix"); | 23 local ok, pposix = pcall(require, "prosody.util.pposix"); |
| 24 if not os_version_command and (ok and pposix and pposix.uname) then | 24 if not os_version_command and (ok and pposix and pposix.uname) then |
| 25 platform = pposix.uname().sysname; | 25 platform = pposix.uname().sysname; |
| 26 end | 26 end |
| 27 if not platform then | 27 if not platform then |
| 28 local uname = io.popen(os_version_command or "uname"); | 28 local uname = io.popen(os_version_command or "uname"); |
