     (->> (d/resolve-tempid db-after tempids new-id)
          (d/entity db-after))))
 
-(defn get-users-subscribed-to-thread [thread-id]
+(defn get-users-subscribed-to-thread
+  [thread-id]
   (d/q '[:find [?user-id ...]
          :in $ ?thread-id
          :where

       (d/db *conn*)
       user-id))

(defn- db->thread [thread]
  {:id (thread :thread/id)
   :messages (map (fn [msg]
                    {:id (msg :message/id)

            (d/db *conn*))
       (map (comp db->message first))))

(defn get-open-thread-ids-for-user
  [user-id]
  (d/q '[:find [?thread-id ...]
                :in $ ?user-id
                :where
