 
 (defun floobits-switch (text)
   (let* ((json-key-type 'string)
-   (req (json-read-from-string text))
-   (event (cdr (assoc "name" req)))
-   (func (concat "floobits-event-" event)))
-    (funcall (read func) req)))
+    (req (json-read-from-string text))
+    (event (cdr (assoc "name" req)))
+    (func (concat "floobits-event-" event)))
+    (print (floo-get-item req 'name))
+      (funcall (read func) req)))
 
 (defun floobits-listener (process response)
   (setq floobits-agent-buffer (concat floobits-agent-buffer response))

  (floobits-auth))

(defun floobits-destroy-connection ()
  (when (and (boundp 'floobits-conn) floobits-conn)
    (message "deleting floobits conn")
    (setq floobits-conn nil)))

(defun floobits-send-to-agent (req event)
  (add-to-list 'req (cons 'version floobits-agent-version))


(defun floobits-launch-agent ()
  (when (boundp 'floobits-twisted-agent)
    (kill-process floobits-twisted-agent)
    (delete-process floobits-twisted-agent))
  (start-process "floobits-twisted-agent" "*Messages*" "~/floobits-agent"))

(defun floobits-leave-room ()
  "leaves the current rooom"
  (interactive)
  (floobits-destroy-connection))

(defun floobits-join-room (floourl)
  "Join a floobits room"
