 		switch name
 			when 'room.join'
 				@emit('roomChanged', data)
+				console.log(data)
+				@userId = data.user.profile.id
+				console.log(@userId)
 				@roomId = data.room.id
 				@historyID = data.room.historyID
 

			@messageHandler msg for msg in data.messages
			return
		if (data.type == 'rpc')
			@rpcHandlers[data.id]?.callback?(data.result)
			@parseRPCReply @rpcHandlers[data.id]?.type, data.result
			delete @rpcHandlers[data.id]

	parseRPCReply: (name, data)->

			maxDJs: maxDJs
		@sendRPC "room.update_options", [@roomId, options], callback

	joinBooth: (callback)->
		@sendRPC "booth.join", [], callback

	leaveBooth: (callback)->
		@sendRPC "booth.leave", [], callback

	removeDj: ()->
		console.log('Not implemented')

	addDj: (callback)->
		@joinBooth(callback)

	remDj: (userid, callback)->
		if (userid && userid != @userid)
			@joinBooth(callback)
		else
			@removeDj(userid, callback)


module.exports = PlugAPI
