Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change strophe.mam.v0.3.js to works #120

Open
wants to merge 215 commits into
base: master
Choose a base branch
from
Open

Conversation

icaro56
Copy link

@icaro56 icaro56 commented Jul 30, 2015

Change to:

/* XEP-0313: Message Archive Management

  • Copyright (C) 2012 Kim Alvefur
    *
  • This file is MIT/X11 licensed. Please see the
  • LICENSE.txt file in the source package for more information.
  • Modified by: Chris Tunbridge (github.com/Destreyf/)
  • Updated to support v0.3 of the XMPP XEP-0313 standard
  • http://xmpp.org/extensions/xep-0313.html
    *
    */
    (function(){
    'use strict';

Strophe.addConnectionPlugin('mam', {
_c: null,
_p: [ 'with', 'start', 'end' ],
init: function (conn) {
this._c = conn;
Strophe.addNamespace('MAM', 'urn:xmpp:mam:0');
},
query: function (jid, options) {
var _p = this._p;
var attr = {
type:'get',
id:jid
};
var mamAttr = {xmlns: Strophe.NS.MAM};
if (!!options['queryid']) {
mamAttr.queryid = options['queryid'];
delete options['queryid'];
}
var iq = $iq(attr).c('query', mamAttr).c('x',{xmlns:'jabber:x:data', type:'submit'});

    iq.c('field',{var:'FORM_TYPE'}).c('value').t('urn:xmpp:mam:0').up().up();
    var i;
    for (i = 0; i < this._p.length; i++) {
        var pn = _p[i];
        var p = options[pn];
        delete options[pn];
        if (!!p) {
            iq.c('field',{var:pn}).c('value').t(p).up().up();
        }
    }
    iq.up();

    var onMessage = options['onMessage'];
    delete options['onMessage'];
    var onComplete = options['onComplete'];
    delete options['onComplete'];
    iq.cnode(new Strophe.RSM(options).toXML());

    this._c.addHandler(onMessage, Strophe.NS.MAM, 'message', null);
    return this._c.sendIQ(iq, onComplete);
}

});

})();

flosse and others added 30 commits January 13, 2013 00:20
Added Out of band file transfer plugin (XEP-0066)
Out of band file transfer
Out of Band Data added to the README.markdown
Out of Band Data added to the README.markdown
Add a missing line of documentation
using Stophe.getText(xmlNode)
IE9 does not work with xmlNode.textContent
roster plugin: Nickname support added to the presence subscription request.
Extended presence support in MUC
with the following error:

    strophe.muc.coffee:11:1: error: unexpected INDENT
    _connection: null
    ^^

using coffeescript 1.6.3
If we don't use the dataforms plugin then the Form object is undefined,
resulting in an error.
Looks like the Tigase BOSH service is no longer available.

Also bumped timeout.
A wrong field name was used here (propably due to refactor)
Caused "block elements" not to be saved.
st-gwerner and others added 26 commits August 25, 2016 16:27
Addition of Message Carbon support XEP-0280
…kmark in the Bookmark PubSub node; it created a new bookmark set (a bookmark storage) with a single bookmark.

Unfortunately, this cannot work with strict XMPP server (like ejabberd) in which they expect to have only one bookmark set (thus one item with a bookmark storage).
In order to work with any XMPP servers, the 'add' method now fetches the whole bookmark set from the XMPP server and then updates it with the new group chat to bookmark.
(It has been tested with JSXC and with OpenFire and Ejabberd as XMPP servers.)
'add' method updates now the whole bookmark storage instead of just adding a new bookmark storage with a single bookmark
…w added into the remote bookmark storage.

The whole bookmark set (under the id 'current') is now fetched from the remote storage, the bookmark to delete is removed from it and then the modified bookmark set is sent to the XMPP server.
…ark. So, the code is updated to take into account this use. A fix has been made also for when no nickname is defined in a bookmark (in that case, no need to go up to the parent node with the up() method).
Fix the bookmark deletion so that is matches the way a bookmark is now added
@jcbrand jcbrand force-pushed the master branch 2 times, most recently from 131f4f1 to 1da5f8c Compare January 25, 2017 14:18
Plugins are now stored in their own repositories.

Updates #123.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.