<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,71 +8,60 @@ AristoChat = {
 var connection = AristoChat.connection; //
 
 function log(msg) {
-    if(DEBUG) {
-        $('#log').append('&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;').append(document.createTextNode(msg));
-    }
-}
-
-function rawInput(data) {
-    log('RECV: ' + data);
-}
-
-function rawOutput(data) {
-    log('SENT: ' + data);
-}
-
+  if(DEBUG) $('#log').append('&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;').append(document.createTextNode(msg)); }
+function rawInput(data) { log('RECV: ' + data); }
+function rawOutput(data) { log('SENT: ' + data); }
 
 function onMessage(msg) {
-    var from = msg.getAttribute('from');
-    var type = msg.getAttribute('type');
-    var body = msg.getElementsByTagName(&quot;body&quot;)[0].childNodes[0];
-    var user = Strophe.getResourceFromJid(from);
-    
-    if (type == &quot;groupchat&quot; &amp;&amp; body) {
-        body = body.nodeValue.replace(/(&lt;([^&gt;]+)&gt;)/ig,&quot;&quot;);
-        if(user == AristoChat.nick) {
-            $('#chat').append(&quot;&lt;tr class='message'&gt;&lt;td class='me'&gt;&quot;+ user + &quot;&lt;/td&gt;&lt;td class='body'&gt;&quot; + body +&quot;&lt;/td&gt;&lt;/tr&gt;&quot;);            
-        }
-        else {
-            $('#chat').append(&quot;&lt;tr class='message'&gt;&lt;td class='nick'&gt;&quot;+ user + &quot;&lt;/td&gt;&lt;td class='body'&gt;&quot; + body +&quot;&lt;/td&gt;&lt;/tr&gt;&quot;);
-        }
-        $('html, body').animate({scrollTop: $('.message:last').offset().top }, 5);
-    }
-    // we must return true to keep the handler alive.  
-    // returning false would remove it after it finishes.
-    return true;
+	var from = msg.getAttribute('from');
+	var type = msg.getAttribute('type');
+	var body = msg.getElementsByTagName(&quot;body&quot;)[0].childNodes[0];
+	var user = Strophe.getResourceFromJid(from);
+
+	if (type == &quot;groupchat&quot; &amp;&amp; body) {
+		body = body.nodeValue.replace(/(&lt;([^&gt;]+)&gt;)/ig,&quot;&quot;);
+		if(user == AristoChat.nick) {
+			$('#chat').append(&quot;&lt;tr class='message'&gt;&lt;td class='me'&gt;&quot;+ user + &quot;&lt;/td&gt;&lt;td class='body'&gt;&quot; + body +&quot;&lt;/td&gt;&lt;/tr&gt;&quot;);            
+		} else {
+			$('#chat').append(&quot;&lt;tr class='message'&gt;&lt;td class='nick'&gt;&quot;+ user + &quot;&lt;/td&gt;&lt;td class='body'&gt;&quot; + body +&quot;&lt;/td&gt;&lt;/tr&gt;&quot;);
+		}
+		$('html, body').animate({scrollTop: $('.message:last').offset().top }, 5);
+	}
+	// we must return true to keep the handler alive.  
+	// returning false would remove it after it finishes.
+	return true;
 }
 
 function user_connected(user) {
-    $('#' + user).hide(&quot;slow&quot;).remove();
-    $('#users').append(&quot;&lt;li id='&quot; + user + &quot;'&gt;&quot;+ user +&quot;&lt;/li&gt;&quot;)
-    $('#chat').append(&quot;&lt;tr class='presence'&gt;&lt;td class='nick'&gt;&quot;+ user + &quot;&lt;/td&gt;&lt;td class='body'&gt;has entered the room&lt;/td&gt;&lt;/tr&gt;&quot;);
-    $('html, body').animate({scrollTop: $('.message:last').offset().top }, 5);
+  $('#' + user).hide(&quot;slow&quot;).remove();
+  $('#users').append(&quot;&lt;li id='&quot; + user + &quot;'&gt;&quot;+ user +&quot;&lt;/li&gt;&quot;)
+  $('#chat').append(&quot;&lt;tr class='presence'&gt;&lt;td class='nick'&gt;&quot;+ user + 
+		&quot;&lt;/td&gt;&lt;td class='body'&gt;has entered the room&lt;/td&gt;&lt;/tr&gt;&quot;);
+  $('html, body').animate({scrollTop: $('.message:last').offset().top }, 5);
 }
 
 function user_disconnected(user) {
-    $('#' + user).hide(&quot;slow&quot;).remove();
-    $('#chat').append(&quot;&lt;tr class='presence'&gt;&lt;td class='nick'&gt;&quot;+ user + &quot;&lt;/td&gt;&lt;td class='body'&gt;has left the room&lt;/td&gt;&lt;/tr&gt;&quot;);
-    $('html, body').animate({scrollTop: $('.message:last').offset().top }, 5);    
+  $('#' + user).hide(&quot;slow&quot;).remove();
+  $('#chat').append(&quot;&lt;tr class='presence'&gt;&lt;td class='nick'&gt;&quot;+ user + 
+		&quot;&lt;/td&gt;&lt;td class='body'&gt;has left the room&lt;/td&gt;&lt;/tr&gt;&quot;);
+  $('html, body').animate({scrollTop: $('.message:last').offset().top }, 5);    
 }
 
 function onPresence(msg) {
-    var user = Strophe.getResourceFromJid(msg.getAttribute('from'));
-    var type = msg.getAttribute('type');
+  var user = Strophe.getResourceFromJid(msg.getAttribute('from'));
+  var type = msg.getAttribute('type');
     
-    if (type == &quot;unavailable&quot;) {
-        user_disconnected(user);
-    }
-    else if (type == &quot;error&quot;) {
-        onDisconnect();
-        alert(msg.getElementsByTagName(&quot;text&quot;)[0].childNodes[0].nodeValue);
-    }
-    else {
-        user_connected(user);
-    }
-    // we must return true to keep the handler alive.  
-    // returning false would remove it after it finishes.
-    return true;
+  if (type == &quot;unavailable&quot;) {
+    user_disconnected(user);
+  } else if (type == &quot;error&quot;) {
+		onDisconnect();
+		alert(msg.getElementsByTagName(&quot;text&quot;)[0].childNodes[0].nodeValue);
+  } else {
+    user_connected(user);
+  } 
+  // we must return true to keep the handler alive.  
+  // returning false would remove it after it finishes.
+  return true;
 }
 
 function onConnect(status) {
@@ -110,7 +99,8 @@ function onConnect(status) {
         connected();
         log('Strophe is connected.');
         // Entrering the room
-        connection.send($pres({to: MUC_ROOM + &quot;@&quot; + MUC_COMPONENT + &quot;/&quot; + AristoChat.nick}).c(&quot;x&quot;, {xmlns: &quot;http://jabber.org/protocol/muc&quot;}).tree());
+        connection.send($pres({to: MUC_ROOM + &quot;@&quot; + MUC_COMPONENT + &quot;/&quot; + AristoChat.nick}).
+					c(&quot;x&quot;, {xmlns: &quot;http://jabber.org/protocol/muc&quot;}).tree());
         $('#loader').hide();
     }
 }
@@ -126,9 +116,9 @@ function connected() {
 }
 
 function onDisconnect() {
-    if(AristoChat.nick != &quot;&quot;) {
-        user_disconnected(AristoChat.nick);
-    }
+    if(AristoChat.nick != &quot;&quot;)
+      user_disconnected(AristoChat.nick);
+   
     $('#post').attr(&quot;disabled&quot;, &quot;disabled&quot;); // To disable
     $('#connect').get(0).value = 'connect';
     $('#login').show();
@@ -153,10 +143,10 @@ $(document).ready(function () {
             $('#connect').attr(&quot;disabled&quot;, &quot;disabled&quot;); // To disable 
             $('#loader').show();
             if($('#nick').get(0).value == &quot;&quot;) {
-                AristoChat.nick = Strophe.getNodeFromJid($('#jid').get(0).value);
+              AristoChat.nick = Strophe.getNodeFromJid($('#jid').get(0).value);
             }
             else {
-                AristoChat.nick = $('#nick').get(0).value;
+            	AristoChat.nick = $('#nick').get(0).value;
             }
             AristoChat.jid = $('#jid').get(0).value;
             AristoChat.password = $('#pass').get(0).value;
@@ -172,9 +162,15 @@ $(document).ready(function () {
 
 function sendMessageWithCallbacks() {
 	var msg = $('#'+AristoChat.inputField).get(0).value.replace(/(&lt;([^&gt;]+)&gt;)/ig,&quot;&quot;);
+
 	msg = AristoChat.onEnterNewMessageBefore(msg);
-	connection.send($msg({to: MUC_ROOM + &quot;@&quot; + MUC_COMPONENT, type: &quot;groupchat&quot;, id: connection.getUniqueId}).c(&quot;body&quot;).t(msg).up().c(&quot;nick&quot;, {xmlns: &quot;http://jabber.org/protocol/nick&quot;}).t(AristoChat.nick).tree());
+	connection.send($msg({to: MUC_ROOM + &quot;@&quot; + MUC_COMPONENT, 
+		type: &quot;groupchat&quot;, id: connection.getUniqueId
+	}).c(&quot;body&quot;).t(msg).up().
+		 c(&quot;nick&quot;, {xmlns: &quot;http://jabber.org/protocol/nick&quot;}).
+		 	 t(AristoChat.nick).tree());
   $('#'+AristoChat.inputField).get(0).value = &quot;&quot;;
+
 	AristoChat.onEnterNewMessageAfter(msg);
 }
 </diff>
      <filename>chat.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7648a3624b2aada70bc38ec348af762fe8ae9a67</id>
    </parent>
  </parents>
  <author>
    <name>Pradeep Elankumaran</name>
    <email>pradeep@intridea.com</email>
  </author>
  <url>http://github.com/superfeedr/aristochat/commit/bcd632242b09f4e12e5b2a8daf4f38dde75c9f13</url>
  <id>bcd632242b09f4e12e5b2a8daf4f38dde75c9f13</id>
  <committed-date>2009-07-11T20:02:17-07:00</committed-date>
  <authored-date>2009-07-11T20:02:17-07:00</authored-date>
  <message>lots of formatting changes, cause i'm painful that way</message>
  <tree>8ea7892fc7182ee4f58c4ff473c6be567aa2d1b7</tree>
  <committer>
    <name>Pradeep Elankumaran</name>
    <email>pradeep@intridea.com</email>
  </committer>
</commit>
