Refactor to no longer user muc.saveConfiguration. updates #307
This commit is contained in:
parent
c893a51ac5
commit
3daf6d6c1a
12
converse.js
12
converse.js
@ -2649,6 +2649,15 @@
|
|||||||
$form.find('input[type=button]').on('click', $.proxy(this.cancelConfiguration, this));
|
$form.find('input[type=button]').on('click', $.proxy(this.cancelConfiguration, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
sendConfiguration: function(config, onSuccess, onError) {
|
||||||
|
// Send an IQ stanza with the room configuration.
|
||||||
|
var iq = $iq({to: this.model.get('jid'), type: "set"})
|
||||||
|
.c("query", {xmlns: Strophe.NS.MUC_OWNER})
|
||||||
|
.c("x", {xmlns: "jabber:x:data", type: "submit"});
|
||||||
|
_.each(config, function (node) { iq.cnode(node); });
|
||||||
|
return converse.connection.sendIQ(iq.tree(), onSuccess, onError);
|
||||||
|
},
|
||||||
|
|
||||||
saveConfiguration: function (ev) {
|
saveConfiguration: function (ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
var that = this;
|
var that = this;
|
||||||
@ -2658,8 +2667,7 @@
|
|||||||
$inputs.each(function () {
|
$inputs.each(function () {
|
||||||
configArray.push(utils.webForm2xForm(this));
|
configArray.push(utils.webForm2xForm(this));
|
||||||
if (!--count) {
|
if (!--count) {
|
||||||
converse.connection.muc.saveConfiguration(
|
that.sendConfiguration(
|
||||||
that.model.get('jid'),
|
|
||||||
configArray,
|
configArray,
|
||||||
$.proxy(that.onConfigSaved, that),
|
$.proxy(that.onConfigSaved, that),
|
||||||
$.proxy(that.onErrorConfigSaved, that)
|
$.proxy(that.onErrorConfigSaved, that)
|
||||||
|
Loading…
Reference in New Issue
Block a user