Fix for mod_version over s2s
[prosody.git] / plugins / mod_version.lua
1
2 local st = require "util.stanza";
3 local send = require "core.sessionmanager".send_to_session;
4
5 local log = require "util.logger".init("mod_version");
6
7 local xmlns_version = "jabber:iq:version"
8
9 local function handle_version_request(session, stanza)
10                         if stanza.attr.type == "get" then
11                                 session.send(st.reply(stanza)
12                                                                 :query(xmlns_version)
13                                                                         :tag("name"):text("lxmppd"):up()
14                                                                         :tag("version"):text("pre-alpha"):up()
15                                                                         :tag("os"):text("The best one"));
16                         end
17 end
18
19 add_iq_handler("c2s", xmlns_version, handle_version_request);
20 add_iq_handler("s2sin", xmlns_version, handle_version_request);