Software /
code /
verse
Changeset
29:0d275519eff4
verse.plugins.version: Fix for handling of version requests
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 09 Dec 2009 20:57:18 +0000 |
parents | 28:afe9e6d6c87a |
children | 30:9c96318913f7 |
files | plugins/version.lua |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/version.lua Wed Dec 09 20:55:34 2009 +0000 +++ b/plugins/version.lua Wed Dec 09 20:57:18 2009 +0000 @@ -1,6 +1,6 @@ local xmlns_version = "jabber:iq:version"; -local function set_version(version_info) +local function set_version(self, version_info) self.name = version_info.name; self.version = version_info.version; self.platform = version_info.platform; @@ -8,9 +8,9 @@ function verse.plugins.version(stream) stream.version = { set = set_version }; - stream:hook("iq/"..xmlns_version, function (event) - if event.stanza.attr.type ~= "get" then return; end - local reply = verse.reply(event.stanza) + stream:hook("iq/"..xmlns_version, function (stanza) + if stanza.attr.type ~= "get" then return; end + local reply = verse.reply(stanza) :tag("query", { xmlns = xmlns_version }); if stream.version.name then reply:tag("name"):text(tostring(stream.version.name)):up(); @@ -21,6 +21,7 @@ if stream.version.platform then reply:tag("os"):text(stream.version.platform); end + stream:send(reply); end); function stream:query_version(target_jid, callback)