<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>app/controllers/messages_controller.rb</filename>
    </added>
    <added>
      <filename>app/helpers/messages_helper.rb</filename>
    </added>
    <added>
      <filename>app/views/messages/new_private_message.rjs</filename>
    </added>
    <added>
      <filename>test/functional/messages_controller_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -6,7 +6,7 @@ class ApplicationController &lt; ActionController::Base
   include AuthenticatedSystem
   # See ActionController::RequestForgeryProtection for details
   # Uncomment the :secret if you're not using the cookie session store
-  protect_from_forgery # :secret =&gt; '9d0e7799e103d6e78392724afa979f3a'
+  #protect_from_forgery # :secret =&gt; '9d0e7799e103d6e78392724afa979f3a'
   
   # See ActionController::Base for details 
   # Uncomment this to filter the contents of submitted sensitive data parameters</diff>
      <filename>app/controllers/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 class ChatRoomsController &lt; ApplicationController
-  before_filter :is_logged_in?, :except =&gt; :index
+  before_filter :is_logged_in?
   # GET /chat_rooms
   # GET /chat_rooms.xml
   def index</diff>
      <filename>app/controllers/chat_rooms_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,21 +2,15 @@ class ConnectionsController &lt; ApplicationController
   around_filter :update_user_list
   
   def login
-    render :juggernaut =&gt; {:type =&gt; :send_to_channels, :channels =&gt; @channels } do |page|
-      page.insert_html :bottom, 'chat_room', &quot;&lt;p style='color:green;font-size:20px;'&gt;#{@user.login} has entered the room&lt;/p&gt;&quot;
-      page.call :scrollChatPanel
-    end
+    update_chat_room(&quot;entered&quot;) unless @channels.include? 0
     
-    #render :nothing =&gt; true
+    render :nothing =&gt; true
   end
 
   def logout
     Juggernaut.remove_channels_from_clients(@user.id, @channels)
     
-    render :juggernaut =&gt; {:type =&gt; :send_to_channels, :channels =&gt; @channels } do |page|
-      page.insert_html :bottom, 'chat_room', &quot;&lt;p style='color:green;font-size:20px;'&gt;#{@user.login} has left the room&lt;/p&gt;&quot;
-      page.call :scrollChatPanel
-    end
+   update_chat_room(&quot;left&quot;) unless @channels.include? 0
     
     render :nothing =&gt; true
   end
@@ -26,7 +20,7 @@ class ConnectionsController &lt; ApplicationController
   def update_user_list
     @user = User.find(params[:client_id])
     
-    @channels = params[:channels].collect{|channel| channel.to_i }
+    @channels = params[:channels].collect{|channel| channel.to_i } if params[:channels]
     
     yield
 
@@ -34,8 +28,15 @@ class ConnectionsController &lt; ApplicationController
       users = User.find(Juggernaut.show_users_for_channels(@channels).collect{ |user| user[&quot;id&quot;] })
         
       render :juggernaut =&gt; {:type =&gt; :send_to_channels, :channels =&gt; @channels } do |page|
-        page.replace_html 'user_list', users.collect{ |user| &quot;&lt;li&gt;#{user.login}&lt;/li&gt;&quot; }.join
+        page.replace_html 'user_list', users.collect{ |user| &quot;&lt;li&gt;&quot;+ link_to_remote(user.login, :url =&gt; &quot;/messages/new_private_message/#{user.id}&quot;)+&quot;&lt;/li&gt;&quot; }.join
       end
     end
   end
+  
+  def update_chat_room(action)
+    render :juggernaut =&gt; {:type =&gt; :send_to_channels, :channels =&gt; @channels } do |page|
+      page.insert_html :bottom, 'chat_room', &quot;&lt;p style='color:green;font-size:20px;'&gt;#{@user.login} has #{action} the room&lt;/p&gt;&quot;
+      page.call :scrollChatPanel
+    end
+  end
 end
\ No newline at end of file</diff>
      <filename>app/controllers/connections_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+&lt;%= juggernaut(:channels =&gt; [0], :client_id =&gt; session[:user_id]) %&gt;
+
 &lt;h1&gt;Listing chat_rooms&lt;/h1&gt;
 
 &lt;table&gt;
@@ -22,3 +24,9 @@
 &lt;br /&gt;
 
 &lt;%= link_to 'New chat_room', new_chat_room_path %&gt;
+
+&lt;br /&gt;
+
+&lt;div id=&quot;user_list&quot;&gt;&lt;/div&gt;
+
+&lt;div id=&quot;private_messages&quot;&gt;&lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/chat_rooms/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,5 @@
 &lt;%= juggernaut(:channels =&gt; [@chat_room.id], :client_id =&gt; session[:user_id]) %&gt;
 
-&lt;script type=&quot;text/javascript&quot;&gt;
-function scrollChatPanel(){
-  div = $('chat_room');			
-  div.scrollTop = 0xffff;
-}
-&lt;/script&gt;
-
 &lt;p&gt;&lt;%= link_to 'Back', chat_rooms_path %&gt;&lt;/p&gt;
 
 &lt;h1&gt;&lt;%=h @chat_room.name %&gt;&lt;/h1&gt;</diff>
      <filename>app/views/chat_rooms/show.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,12 @@
   &lt;title&gt;ChatRooms: &lt;%= controller.action_name %&gt;&lt;/title&gt;
   &lt;%= javascript_include_tag 'prototype', :juggernaut %&gt;
   &lt;%= stylesheet_link_tag 'scaffold' %&gt;
+  &lt;script type=&quot;text/javascript&quot;&gt;
+	function scrollChatPanel(room){
+	  div = $(room);			
+	  div.scrollTop = 0xffff;
+	}
+  &lt;/script&gt;
 &lt;/head&gt;
 &lt;body&gt;
 </diff>
      <filename>app/views/layouts/application.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -32,7 +32,7 @@
 #
 :allowed_ips: 
       - 127.0.0.1
-      # - 192.168.0.1
+      #- 192.168.0.6
 
 # 2) Via HTTP request
 # </diff>
      <filename>juggernaut.yml</filename>
    </modified>
    <modified>
      <diff>@@ -64,6 +64,18 @@ a:hover { color: #fff; background-color:#000; }
 	scrollbar-3dlight-color:B1D0F0;
 }
 
+.scroller{
+	border:1px solid black;
+	overflow-y: scroll;
+	scrollbar-arrow-color:000000;
+	scrollbar-track-color:000000;
+	scrollbar-shadow-color:B1D0F0;
+	scrollbar-face-color:B1D0F0;
+	scrollbar-highlight-color:B1D0F0;
+	scrollbar-darkshadow-color:B1D0F0;
+	scrollbar-3dlight-color:B1D0F0;
+}
+
 #chat_room
 {
 	float: left;
@@ -90,4 +102,16 @@ a:hover { color: #fff; background-color:#000; }
 	margin-top: 10px;
 	font-size: 15px;
 	border: 1px solid black;
+}
+
+.private_message{
+	margin-left :10px;
+	float: left; 
+	height: 400px; 
+	padding: 10px;
+	border: 1px solid black;	
+}
+
+.private_chat_room{
+	height: 350px;
 }
\ No newline at end of file</diff>
      <filename>public/stylesheets/scaffold.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>48b84003b3bbe874eccdd164582aba77cf9c9450</id>
    </parent>
  </parents>
  <author>
    <name>Taylor Redden</name>
    <email>thredden21@tntech.edu</email>
  </author>
  <url>http://github.com/taelor/chat_sandbox/commit/338e9657999fe4618ac3d24e8b8d4c1012e52bb4</url>
  <id>338e9657999fe4618ac3d24e8b8d4c1012e52bb4</id>
  <committed-date>2008-08-11T19:23:20-07:00</committed-date>
  <authored-date>2008-08-11T19:23:20-07:00</authored-date>
  <message>added private messaging, needs refactoring</message>
  <tree>8fcd4dda879b52ba864186ff517510952eda5096</tree>
  <committer>
    <name>Taylor Redden</name>
    <email>thredden21@tntech.edu</email>
  </committer>
</commit>
