comparison plugins/PLAIN.js @ 68:e1ccfb580228

Replaces that by Conn.
author Sonny Piers <sonny.piers@gmail.com>
date Thu, 02 Feb 2012 00:00:34 +0100
parents fa184759fc41
children c06ec02217ee
comparison
equal deleted inserted replaced
67:1c8f326fe3ef 68:e1ccfb580228
51 " xmlns:stream='http://etherx.jabber.org/streams'" + 51 " xmlns:stream='http://etherx.jabber.org/streams'" +
52 " version='1.0'/>" 52 " version='1.0'/>"
53 ); 53 );
54 }, 54 },
55 'features': function (stanza) { 55 'features': function (stanza) {
56 var that = this; 56 var Conn = this;
57 //TODO check if bind supported 57 //TODO check if bind supported
58 var bind = 58 var bind =
59 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" + 59 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" +
60 "<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>" + 60 "<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>" +
61 (this.jid.resource? "<resource>" + this.jid.resource + "</resource>": "") + 61 (this.jid.resource? "<resource>" + this.jid.resource + "</resource>": "") +
64 this.send( 64 this.send(
65 bind, 65 bind,
66 //Success 66 //Success
67 function(stanza) { 67 function(stanza) {
68 //Session http://xmpp.org/rfcs/rfc3921.html#session 68 //Session http://xmpp.org/rfcs/rfc3921.html#session
69 that.jid = new Lightstring.JID(stanza.DOM.textContent); 69 Conn.jid = new Lightstring.JID(stanza.DOM.textContent);
70 that.send( 70 Conn.send(
71 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" + 71 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" +
72 "<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>" + 72 "<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>" +
73 "</iq>", 73 "</iq>",
74 function() { 74 function() {
75 that.emit('connected'); 75 Conn.emit('connected');
76 } 76 }
77 ); 77 );
78 }, 78 },
79 //Error 79 //Error
80 function(stanza) { 80 function(stanza) {