I think this fixes #1160
Don't included MAM data form if there's nothing to filter
This commit is contained in:
parent
012dd1328a
commit
99432eebd9
@ -43,10 +43,11 @@
|
|||||||
if (_.isFunction(options)) {
|
if (_.isFunction(options)) {
|
||||||
callback = options;
|
callback = options;
|
||||||
errback = callback;
|
errback = callback;
|
||||||
|
options = null;
|
||||||
}
|
}
|
||||||
const queryid = _converse.connection.getUniqueId();
|
const queryid = _converse.connection.getUniqueId();
|
||||||
const attrs = {'type':'set'};
|
const attrs = {'type':'set'};
|
||||||
if (!_.isUndefined(options) && options.groupchat) {
|
if (options && options.groupchat) {
|
||||||
if (!options['with']) { // eslint-disable-line dot-notation
|
if (!options['with']) { // eslint-disable-line dot-notation
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'You need to specify a "with" value containing '+
|
'You need to specify a "with" value containing '+
|
||||||
@ -54,8 +55,9 @@
|
|||||||
}
|
}
|
||||||
attrs.to = options['with']; // eslint-disable-line dot-notation
|
attrs.to = options['with']; // eslint-disable-line dot-notation
|
||||||
}
|
}
|
||||||
|
|
||||||
const stanza = $iq(attrs).c('query', {'xmlns':Strophe.NS.MAM, 'queryid':queryid});
|
const stanza = $iq(attrs).c('query', {'xmlns':Strophe.NS.MAM, 'queryid':queryid});
|
||||||
if (!_.isUndefined(options)) {
|
if (options) {
|
||||||
stanza.c('x', {'xmlns':Strophe.NS.XFORM, 'type': 'submit'})
|
stanza.c('x', {'xmlns':Strophe.NS.XFORM, 'type': 'submit'})
|
||||||
.c('field', {'var':'FORM_TYPE', 'type': 'hidden'})
|
.c('field', {'var':'FORM_TYPE', 'type': 'hidden'})
|
||||||
.c('value').t(Strophe.NS.MAM).up().up();
|
.c('value').t(Strophe.NS.MAM).up().up();
|
||||||
|
Loading…
Reference in New Issue
Block a user