Software / code / prosody
Comparison
plugins/mod_version.lua @ 541:3521e0851c9e
Change modules to use the new add_feature module API method.
This also fixes the bug causing disco features being added to every disco reply for every host.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Thu, 04 Dec 2008 20:16:30 +0500 |
| parent | 519:cccd610a0ef9 |
| child | 615:4ae3e81513f3 |
comparison
equal
deleted
inserted
replaced
| 540:ec03f6968fa8 | 541:3521e0851c9e |
|---|---|
| 23 | 23 |
| 24 local log = require "util.logger".init("mod_version"); | 24 local log = require "util.logger".init("mod_version"); |
| 25 | 25 |
| 26 local xmlns_version = "jabber:iq:version" | 26 local xmlns_version = "jabber:iq:version" |
| 27 | 27 |
| 28 require "core.discomanager".set("version", xmlns_version); | 28 module:add_feature(xmlns_version); |
| 29 | 29 |
| 30 local function handle_version_request(session, stanza) | 30 local function handle_version_request(session, stanza) |
| 31 if stanza.attr.type == "get" then | 31 if stanza.attr.type == "get" then |
| 32 session.send(st.reply(stanza):query(xmlns_version) | 32 session.send(st.reply(stanza):query(xmlns_version) |
| 33 :tag("name"):text("Prosody"):up() | 33 :tag("name"):text("Prosody"):up() |