From cd723ac964f9afbdb73a8702b9b0c368a99e98ce Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 1 Oct 2012 17:31:47 -0400 Subject: [PATCH] create connection row on login --- lib/jam_websockets/router.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/jam_websockets/router.rb b/lib/jam_websockets/router.rb index afac38298..c8ac46f01 100644 --- a/lib/jam_websockets/router.rb +++ b/lib/jam_websockets/router.rb @@ -443,6 +443,12 @@ module JamWebsockets login_ack = @message_factory.login_ack(remote_ip) send_to_client(client, login_ack) + # log this connection in the database + connection = Connection.new() + connection.user_id = user.id + connection.client_id = client.client_id + connection.save + # remove from pending_queue @semaphore.synchronize do @pending_clients.delete(client) @@ -535,7 +541,7 @@ module JamWebsockets else raise SessionError, 'no login data was found in Login message' end - +:properties => { :headers => { "client_id" => client.client_id } } ) end def access_jam_session?(jam_session_id, user)