Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/strophe.mam.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* http://xmpp.org/extensions/xep-0313.html
*
*/
import { $iq, Strophe } from 'strophe.js';
//import { $iq, Strophe } from 'strophe.js'; NOTE: Can make issues on some systems
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't just comment this out...

Either create a ticket where you explain what the problem is, or make a separate pull request for specifically this issue.


Strophe.addConnectionPlugin('mam', {
_c: null,
Expand All @@ -32,7 +32,11 @@ Strophe.addConnectionPlugin('mam', {
}
var iq = $iq(attr).c('query', mamAttr).c('x',{xmlns:'jabber:x:data', type:'submit'});

iq.c('field',{var:'FORM_TYPE', type:'hidden'}).c('value').t(Strophe.NS.MAM).up().up();
var ns = Strophe.NS.MAM;
if ( options.oldVersion )
ns = 'urn:xmpp:mam:1';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you introduce the oldVersion option? Doesn't look like it's documented anywhere. Additionally, it's unnecessarily vague. Instead of oldVersion, perhaps the actual version number could be specified?


iq.c('field',{var:'FORM_TYPE', type:'hidden'}).c('value').t(ns).up().up();
var i;
for (i = 0; i < this._p.length; i++) {
var pn = _p[i];
Expand All @@ -48,13 +52,15 @@ Strophe.addConnectionPlugin('mam', {
delete options.onMessage;
var onComplete = options.onComplete;
delete options.onComplete;
var onError = options.onError;
delete options.onError;
iq.cnode(new Strophe.RSM(options).toXML());

var _c = this._c;
var handler = _c.addHandler(onMessage, Strophe.NS.MAM, 'message', null);
return this._c.sendIQ(iq, function(){
_c.deleteHandler(handler);
onComplete.apply(this, arguments);
});
},onError);
}
});