whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: make users an array; remove debug statements
Date Wed, 12 Oct 2016 16:20:40 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  5bdc75d   make users an array; remove debug statements
5bdc75d is described below

commit 5bdc75d0686579c504b988f3687dd2f8e64fda76
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Wed Oct 12 12:20:06 2016 -0400

    make users an array; remove debug statements
---
 www/board/agenda/daemon/wsc.rb | 2 +-
 www/board/agenda/daemon/wss.rb | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/www/board/agenda/daemon/wsc.rb b/www/board/agenda/daemon/wsc.rb
index 7d4bc30..ac00bb0 100644
--- a/www/board/agenda/daemon/wsc.rb
+++ b/www/board/agenda/daemon/wsc.rb
@@ -63,5 +63,5 @@ ws.on :error do |e|
 end
 
 loop do
-  ws.send STDIN.gets.strip
+  ws.send STDIN.gets
 end
diff --git a/www/board/agenda/daemon/wss.rb b/www/board/agenda/daemon/wss.rb
index 2878736..093002e 100755
--- a/www/board/agenda/daemon/wss.rb
+++ b/www/board/agenda/daemon/wss.rb
@@ -9,7 +9,7 @@ require 'rbconfig'
 
 require_relative './session'
 
-users = {}
+users = Hash.new {|hash, key| hash[key] = []}
 sessions = {}
 
 ########################################################################
@@ -120,12 +120,11 @@ EM.run do
       headers = YAML.safe_load(headers) || {} rescue {}
 
       if headers['session']
-        STDERR.puts headers.inspect
         session = Session[headers['session']]
-        STDERR.puts session.inspect
         if session
-          users[session[:id]] = ws
+          users[session[:id]] << ws
           sessions[ws] = session[:id]
+          ws.send JSON.dump(session.merge type: 'login')
         end
       end
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message