                         (fn [_] nil))]
               (if-not conn
                 ;; You didn't connect over ws://
-                invalid-websocket-response
+                invalid-response
 
                 ;; First message should be of the form "inited:<INITIAL TEXT>"
                 (d/let-flow

                        (fn [_] nil))]
              (if-not conn
                ;; You didn't connect over ws://
                invalid-websocket-response

                (let [s (find-stream stream-id)]
                  ;; Send existing nonsense
                  (s/put! conn
                          (str "insert:"
                               (:text s)))

                  (s/put! conn
                          (str "cursor:"
                               (:pos s)))

                  ;; Feed messages to clients
                  (s/connect
                   (bus/subscribe streamrooms stream-id)
                   conn)))))

(defn new-stream-handler [request]
  (d/let-flow [conn (d/catch

            [manifold.bus :as bus]
            [clojure.core.async :as async]))

(def invalid-response
  {:status 400
   :headers {"Content-Type" "text/plain"}
   :body "<h1>400</h1> This isn't what I wanted!"})

;;; The following is *very bad* *placeholder* code, to be replaced with an
;;; actual database ASAP.
