Mercurial > prosody-hg
annotate plugins/mod_version.lua @ 373:dd0345edeaf4
Add helper function for adding message bodies to stanzas
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 22 Nov 2008 19:07:41 +0000 |
| parents | 851f271d25b0 |
| children | 63be85693710 |
| rev | line source |
|---|---|
| 188 | 1 |
| 2 local st = require "util.stanza"; | |
| 3 | |
| 4 local log = require "util.logger".init("mod_version"); | |
| 5 | |
| 6 local xmlns_version = "jabber:iq:version" | |
| 7 | |
| 8 local function handle_version_request(session, stanza) | |
| 219 | 9 if stanza.attr.type == "get" then |
| 10 session.send(st.reply(stanza):query(xmlns_version) | |
| 11 :tag("name"):text("lxmppd"):up() | |
| 12 :tag("version"):text("pre-alpha"):up() | |
| 298 | 13 :tag("os"):text("the best operating system ever!")); |
| 219 | 14 end |
| 188 | 15 end |
| 16 | |
| 17 add_iq_handler("c2s", xmlns_version, handle_version_request); | |
|
189
3f0e3a07b491
Fix for mod_version over s2s
Matthew Wild <mwild1@gmail.com>
parents:
188
diff
changeset
|
18 add_iq_handler("s2sin", xmlns_version, handle_version_request); |
