changeset 18:48bc65a0e0f1

add pubsub config
author Sonny Piers <sonny.piers@gmail.com>
date Sat, 28 Jan 2012 01:24:04 +0100
parents b7bd814333eb
children fc577e5b2f4a
files lightstring.js
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lightstring.js
+++ b/lightstring.js
@@ -24,14 +24,14 @@ var Lightstring = {
   /**
    * @namespace Holds XMPP namespaces.
    */
-	NS: {
+  NS: {
     stream: 'http://etherx.jabber.org/streams',
     jabberClient: 'jabber:client'
   },
   /**
    * @namespace Holds XMPP stanza builders.
    */
-	stanza: {
+  stanza: {
     stream: {
       open: function(aService) {
         //FIXME no ending "/" - node-xmpp-bosh bug
@@ -262,7 +262,7 @@ Lightstring.Connection.prototype = {
       console.log(e.data);
     });
     this.socket.addEventListener('close', function(e) {
-			that.emit('disconnected', e.data);
+      that.emit('disconnected', e.data);
     });
     this.socket.addEventListener('message', function(e) {
       that.emit('XMLInput', e.data);
@@ -270,8 +270,8 @@ Lightstring.Connection.prototype = {
       that.emit('DOMInput', elm);
       that.emit(elm.tagName, elm);
 
-			if (elm.tagName === 'iq')
-				that.emit(elm.getAttribute('id'), elm);
+      if (elm.tagName === 'iq')
+        that.emit(elm.getAttribute('id'), elm);
     });
   },
   /**
@@ -295,7 +295,7 @@ Lightstring.Connection.prototype = {
 
 
     if (elm.tagName === 'iq') {
-			var id = elm.getAttribute('id');
+      var id = elm.getAttribute('id');
       if (!id) {
         elm.setAttribute('id', this.getNewId());
         str = Lightstring.dom2xml(elm);
@@ -316,12 +316,12 @@ Lightstring.Connection.prototype = {
    * @function Closes the XMPP stream and the socket.
    */
   disconnect: function() {
-		this.emit('disconnecting');
+    this.emit('disconnecting');
     var stream = Lightstring.stanza.stream.close();
-		this.send(stream);
+    this.send(stream);
     this.emit('XMLOutput', stream);
-		this.socket.close();
-	},
+    this.socket.close();
+  },
   /**
    * @function Emits an event.
    * @param {String} aName The event name.