                                                                              team))
                            :entity-type :access-request}]))))
 
+(defn subscriber-read-api [subscriber]
+  (-> subscriber
+    (select-keys [:client-id
+                  :cust/uuid
+                  :cust/name
+                  :cust/color-name
+                  :frontend-id-seed
+                  :hide-in-list?
+                  :tool
+                  :layers
+                  :relation
+                  :recording?
+                  :show-mouse?])
+    (merge (when (:mouse-position subscriber)
+             (select-keys subscriber [:mouse-position])))))
+
 ;; TODO: subscribe should be the only function you need when you get to a doc, then it should send
 ;;       all of the data asynchronously
 (defmethod ws-handler :frontend/subscribe [{:keys [client-id ?data ?reply-fn] :as req}]

        mouse-position (-> ?data :mouse-position)
        tool (-> ?data :tool)
        layers (-> ?data :layers)
        relation (-> ?data :relation)]
    (doseq [[uid _] (dissoc (get @document-subs document-id) client-id)]
      ((:send-fn @sente-state) uid [:frontend/mouse-move (merge
                                                          {:client-id client-id
                                                           :tool tool
                                                           :layers layers
                                                           :relation relation}
                                                          (when mouse-position
                                                            {:mouse-position mouse-position}))]))))

(defmethod ws-handler :frontend/update-self [{:keys [client-id ?data] :as req}]
  ;; TODO: update subscribers in a different way

                                             :max-document-scope (auth/max-document-scope (:db req) doc (get-in req [:ring-req :auth]))}])

    (doseq [[uid _] (get @document-subs document-id)]
      (send-fn uid [:frontend/subscriber-joined (subscriber-read-api (merge {:client-id client-id}
                                                                            (get-in subs [document-id client-id])))]))

    ;; TODO: we'll need a read-api or something here at some point
    (log/infof "sending document for %s to %s" document-id client-id)
