Software / code / prosody
Comparison
plugins/mod_version.lua @ 219:f06e97f525bc
Fixed some whitespace.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Thu, 06 Nov 2008 16:57:10 +0500 |
| parent | 189:3f0e3a07b491 |
| child | 298:985710ea308b |
comparison
equal
deleted
inserted
replaced
| 218:1263896ab2f1 | 219:f06e97f525bc |
|---|---|
| 5 local log = require "util.logger".init("mod_version"); | 5 local log = require "util.logger".init("mod_version"); |
| 6 | 6 |
| 7 local xmlns_version = "jabber:iq:version" | 7 local xmlns_version = "jabber:iq:version" |
| 8 | 8 |
| 9 local function handle_version_request(session, stanza) | 9 local function handle_version_request(session, stanza) |
| 10 if stanza.attr.type == "get" then | 10 if stanza.attr.type == "get" then |
| 11 session.send(st.reply(stanza) | 11 session.send(st.reply(stanza):query(xmlns_version) |
| 12 :query(xmlns_version) | 12 :tag("name"):text("lxmppd"):up() |
| 13 :tag("name"):text("lxmppd"):up() | 13 :tag("version"):text("pre-alpha"):up() |
| 14 :tag("version"):text("pre-alpha"):up() | 14 :tag("os"):text("The best one")); |
| 15 :tag("os"):text("The best one")); | 15 end |
| 16 end | |
| 17 end | 16 end |
| 18 | 17 |
| 19 add_iq_handler("c2s", xmlns_version, handle_version_request); | 18 add_iq_handler("c2s", xmlns_version, handle_version_request); |
| 20 add_iq_handler("s2sin", xmlns_version, handle_version_request); | 19 add_iq_handler("s2sin", xmlns_version, handle_version_request); |