     (->> (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- get-users-subscribed-to-tag [tag-id]
  (d/q '[:find [?user-id ...]
         :in $ ?tag-id
         :where

                   (tag :tag/id))
                 (thread :thread/tag))})

(defn get-open-threads-for-user
  [user-id]
  (->> (d/q '[:find (pull ?thread [:thread/id
                                   {:thread/tag [:tag/id]}
                                   {:message/_thread [:message/id
