comparison plugins/PLAIN.js @ 65:2e8fbf3bce7f

ANONYMOUS auth plugin.
author Sonny Piers <sonny.piers@gmail.com>
date Wed, 01 Feb 2012 21:23:28 +0100
parents d9f5ae0b6d98
children fa184759fc41
comparison
equal deleted inserted replaced
64:d9f5ae0b6d98 65:2e8fbf3bce7f
44 }, 44 },
45 'features': function (stanza) { 45 'features': function (stanza) {
46 var that = this; 46 var that = this;
47 //TODO check if bind supported 47 //TODO check if bind supported
48 var bind = 48 var bind =
49 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"' xmlns='jabber:client'>" + 49 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" +
50 "<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>" + 50 "<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>" +
51 (this.jid.resource? "<resource>" + this.jid.resource + "</resource>": "") + 51 (this.jid.resource? "<resource>" + this.jid.resource + "</resource>": "") +
52 "</bind>" + 52 "</bind>" +
53 "</iq>"; 53 "</iq>";
54 this.send( 54 this.send(
56 //Success 56 //Success
57 function(stanza) { 57 function(stanza) {
58 //Session http://xmpp.org/rfcs/rfc3921.html#session 58 //Session http://xmpp.org/rfcs/rfc3921.html#session
59 that.jid = new Lightstring.JID(stanza.DOM.textContent); 59 that.jid = new Lightstring.JID(stanza.DOM.textContent);
60 that.send( 60 that.send(
61 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"' xmlns='jabber:client'>" + 61 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" +
62 "<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>" + 62 "<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>" +
63 "</iq>", 63 "</iq>",
64 function() { 64 function() {
65 that.emit('connected'); 65 that.emit('connected');
66 } 66 }