plugins/mod_version.lua

changeset 1312
ad7d144b6796
parent 894
2c0b9e3c11c3
child 1523
841d61be198f
equal deleted inserted replaced
1311:fc113027a1d5 1312:ad7d144b6796
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 9
10 10 local prosody = prosody;
11 local st = require "util.stanza"; 11 local st = require "util.stanza";
12 12
13 local xmlns_version = "jabber:iq:version" 13 local xmlns_version = "jabber:iq:version"
14 14
15 module:add_feature(xmlns_version); 15 module:add_feature(xmlns_version);
33 33
34 module:add_iq_handler({"c2s", "s2sin"}, xmlns_version, function(session, stanza) 34 module:add_iq_handler({"c2s", "s2sin"}, xmlns_version, function(session, stanza)
35 if stanza.attr.type == "get" then 35 if stanza.attr.type == "get" then
36 session.send(st.reply(stanza):query(xmlns_version) 36 session.send(st.reply(stanza):query(xmlns_version)
37 :tag("name"):text("Prosody"):up() 37 :tag("name"):text("Prosody"):up()
38 :tag("version"):text("0.4"):up() 38 :tag("version"):text(prosody.version):up()
39 :tag("os"):text(version)); 39 :tag("os"):text(version));
40 end 40 end
41 end); 41 end);

mercurial