   ; subscribe to a tag they can't?
   (when (user-in-tag-group? user-id tag-id)
     (d/transact conn [[:db/add [:user/id user-id]
-                         :user/subscribed-tag [:tag/id tag-id]]])))
+                       :user/subscribed-tag [:tag/id tag-id]]])))
 
 (defn user-unsubscribe-from-tag!
   [user-id tag-id]
   (d/transact conn [[:db/retract [:user/id user-id]
-                       :user/subscribed-tag [:tag/id tag-id]]]))
+                     :user/subscribed-tag [:tag/id tag-id]]]))
 
 (defn user-add-to-group! [user-id group-id]
   (d/transact conn [[:db/add [:group/id group-id]
-                       :group/user [:user/id user-id]]]))
+                     :group/user [:user/id user-id]]]))
 
 (defn user-make-group-admin! [user-id group-id]
   (d/transact conn [[:db/add [:group/id group-id]
-                       :group/user [:user/id user-id]]
-                      [:db/add [:group/id group-id]
-                       :group/admins [:user/id user-id]]]))
+                     :group/user [:user/id user-id]]
+                    [:db/add [:group/id group-id]
+                     :group/admins [:user/id user-id]]]))
 
 (defn user-is-group-admin?
   [user-id group-id]

  [attrs]
  (let [new-id (d/tempid :entities)
        {:keys [db-after tempids]} @(d/transact conn
                                                [(assoc attrs :db/id new-id)])]
    (->> (d/resolve-tempid db-after tempids new-id)
         (d/entity db-after))))


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

