Software /
code /
prosody-modules
Comparison
mod_adhoc/adhoc/adhoc.lib.lua @ 169:b3a68e71b8a1
mod_adhoc, mod_adhoc_cmd_admin: Handle errors according to XEP
author | Florian Zeitz < florob@babelmonkeys.de> |
---|---|
date | Thu, 10 Jun 2010 22:32:49 +0200 |
parent | 149:b8a89ebf71e3 |
child | 207:1ae653712e37 |
comparison
equal
deleted
inserted
replaced
168:cd8492748985 | 169:b3a68e71b8a1 |
---|---|
1 -- Copyright (C) 2009-2010 Florian Zeitz | |
2 -- | |
3 -- This file is MIT/X11 licensed. Please see the | |
4 -- COPYING file in the source package for more information. | |
5 -- | |
6 | |
1 local st, uuid = require "util.stanza", require "util.uuid"; | 7 local st, uuid = require "util.stanza", require "util.uuid"; |
2 | 8 |
3 local xmlns_cmd = "http://jabber.org/protocol/commands"; | 9 local xmlns_cmd = "http://jabber.org/protocol/commands"; |
4 | 10 |
5 local states = {} | 11 local states = {} |
36 states[sessionid] = nil; | 42 states[sessionid] = nil; |
37 cmdtag = command:cmdtag("canceled", sessionid); | 43 cmdtag = command:cmdtag("canceled", sessionid); |
38 elseif data.status == "error" then | 44 elseif data.status == "error" then |
39 states[sessionid] = nil; | 45 states[sessionid] = nil; |
40 stanza = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message); | 46 stanza = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message); |
41 cmdtag = command:cmdtag("canceled", sessionid); | 47 origin.send(stanza); |
48 return true; | |
42 else | 49 else |
43 cmdtag = command:cmdtag("executing", sessionid); | 50 cmdtag = command:cmdtag("executing", sessionid); |
44 end | 51 end |
45 | 52 |
46 for name, content in pairs(data) do | 53 for name, content in pairs(data) do |