comparison plugins/ANONYMOUS.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
comparison
equal deleted inserted replaced
67:1c8f326fe3ef 68:e1ccfb580228
46 " xmlns:stream='http://etherx.jabber.org/streams'" + 46 " xmlns:stream='http://etherx.jabber.org/streams'" +
47 " version='1.0'/>" 47 " version='1.0'/>"
48 ); 48 );
49 }, 49 },
50 'features': function (stanza) { 50 'features': function (stanza) {
51 var that = this; 51 var Conn = this;
52 //TODO check if bind supported 52 //TODO check if bind supported
53 var bind = 53 var bind =
54 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" + 54 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" +
55 "<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>" + 55 "<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>" +
56 "</iq>"; 56 "</iq>";
58 this.send( 58 this.send(
59 bind, 59 bind,
60 //Success 60 //Success
61 function(stanza) { 61 function(stanza) {
62 //Session http://xmpp.org/rfcs/rfc3921.html#session 62 //Session http://xmpp.org/rfcs/rfc3921.html#session
63 that.jid = new Lightstring.JID(stanza.DOM.textContent); 63 Conn.jid = new Lightstring.JID(stanza.DOM.textContent);
64 64
65 that.send( 65 Conn.send(
66 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" + 66 "<iq type='set' id='"+Lightstring.newId('sendiq:')+"'>" +
67 "<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>" + 67 "<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>" +
68 "</iq>", 68 "</iq>",
69 function() { 69 function() {
70 that.emit('connected'); 70 Conn.emit('connected');
71 } 71 }
72 ); 72 );
73 }, 73 },
74 //Error 74 //Error
75 function(stanza) { 75 function(stanza) {