                           (json/generate-string {:id (rand-int 1e6)
                                                  :type "ping"})))))
 
-(defn route-messages [ws-conn incoming-messages]
+(defn route-messages [conn incoming-messages]
   (future (while true
-            (let [msg (json/parse-string @(stream/take! ws-conn) true)]
+            (let [msg (json/parse-string @(stream/take! (:ws-conn conn)) true)]
               (condp = (:type msg)
-                "message" (do (println "OK")
-                              (async/put! incoming-messages msg))
+                "message" (when-not (= (:user msg) (:id (:self conn)))
+                            (async/put! incoming-messages msg))
                 (do #_ignore))))))
 
 (defn websocket-client [url incoming-messages]

                      (json/parse-string true))
        incoming-messages (async/chan)
        ws-conn (websocket-client (:url conn-data)
                                  incoming-messages)]
    (assoc conn-data
           :ws-conn ws-conn
           :incoming-messages incoming-messages)))

(defn find-user-dm-id [conn user]
  (let [user-id (some #(if (= (:name %) user)

    (when-not (= first-msg {"type" "hello"})
      (throw (ex-info "Unable to connect" first-msg)))
    (keep-alive conn)

    conn))

(defn connect [token]
