Annotate

plugins/mod_version.lua @ 512:eb50ee09c2bb

'install' libs to util before top-level make install
author Matthew Wild <mwild1@gmail.com>
date Sun, 30 Nov 2008 19:31:43 +0000
parent 438:193f9dd64f17
child 517:afd9f6590fd0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
188
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 local st = require "util.stanza";
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 local log = require "util.logger".init("mod_version");
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 local xmlns_version = "jabber:iq:version"
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
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
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 local function handle_version_request(session, stanza)
219
f06e97f525bc Fixed some whitespace.
Waqas Hussain <waqas20@gmail.com>
parents: 189
diff changeset
11 if stanza.attr.type == "get" then
f06e97f525bc Fixed some whitespace.
Waqas Hussain <waqas20@gmail.com>
parents: 189
diff changeset
12 session.send(st.reply(stanza):query(xmlns_version)
f06e97f525bc Fixed some whitespace.
Waqas Hussain <waqas20@gmail.com>
parents: 189
diff changeset
13 :tag("name"):text("lxmppd"):up()
f06e97f525bc Fixed some whitespace.
Waqas Hussain <waqas20@gmail.com>
parents: 189
diff changeset
14 :tag("version"):text("pre-alpha"):up()
298
985710ea308b Small fix for mod_version
Matthew Wild <mwild1@gmail.com>
parents: 219
diff changeset
15 :tag("os"):text("the best operating system ever!"));
219
f06e97f525bc Fixed some whitespace.
Waqas Hussain <waqas20@gmail.com>
parents: 189
diff changeset
16 end
188
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17 end
0d9f03009b8a mod_version is here
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
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);