# HG changeset patch # User Emmanuel Gil Peyrot # Date 1287793869 -7200 # Node ID 0f42c9c8085af26934b5b4865a4c08389fdeb5dd # Parent e55b31f12f8c6e6ae21371b73f0f052e6a93e452 Fix configure setting error and handle cancelling of configure. diff --git a/psgxs.js b/psgxs.js --- a/psgxs.js +++ b/psgxs.js @@ -793,6 +793,8 @@ function onIq(stanza) { if (!config.enabled('config-node')) return makeError(response, errors.owner.configure.node_configuration_not_supported.n); + var configure = pubsub.getChild('configure'); + var nodeID = configure.getAttribute('node'); if (!nodeID) return makeError(response, errors.nodeid_required.n); @@ -804,7 +806,15 @@ function onIq(stanza) { return makeError(response, errors.forbidden.n); var x = configure.getChild('x', 'jabber:x:data'); - if (!x || x.getAttribute(type) != 'submit') + if (!x) + return makeError(response, errors.bad_request.n); + + var type = x.getAttribute('type'); + if (type == 'cancel') { + conn.send(response); + return; + } + if (type != 'submit') return makeError(response, errors.bad_request.n); var form = forms.parse(x, true);