Software /
code /
prosody
Annotate
plugins/mod_version.lua @ 517:afd9f6590fd0
lxmppd -> Prosody
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 03 Dec 2008 13:02:23 +0000 |
parent | 438:193f9dd64f17 |
child | 519:cccd610a0ef9 |
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 | |
421
63be85693710
Modules now sending disco replies
Waqas Hussain <waqas20@gmail.com>
parents:
314
diff
changeset
|
8 require "core.discomanager".set("version", xmlns_version); |
63be85693710
Modules now sending disco replies
Waqas Hussain <waqas20@gmail.com>
parents:
314
diff
changeset
|
9 |
188 | 10 local function handle_version_request(session, stanza) |
219 | 11 if stanza.attr.type == "get" then |
12 session.send(st.reply(stanza):query(xmlns_version) | |
517 | 13 :tag("name"):text("Prosody"):up() |
14 :tag("version"):text("0.1"):up() | |
298 | 15 :tag("os"):text("the best operating system ever!")); |
219 | 16 end |
188 | 17 end |
18 | |
438
193f9dd64f17
Bumper commit for the new modulemanager API \o/ Updates all the modules, though some more changes may be in store.
Matthew Wild <mwild1@gmail.com>
parents:
421
diff
changeset
|
19 module:add_iq_handler("c2s", xmlns_version, handle_version_request); |
193f9dd64f17
Bumper commit for the new modulemanager API \o/ Updates all the modules, though some more changes may be in store.
Matthew Wild <mwild1@gmail.com>
parents:
421
diff
changeset
|
20 module:add_iq_handler("s2sin", xmlns_version, handle_version_request); |