diff --git a/src/main/java/com/threerings/user/depot/DepotUserRepository.java b/src/main/java/com/threerings/user/depot/DepotUserRepository.java index 6ff47e0..59039e2 100644 --- a/src/main/java/com/threerings/user/depot/DepotUserRepository.java +++ b/src/main/java/com/threerings/user/depot/DepotUserRepository.java @@ -606,6 +606,15 @@ public class DepotUserRepository extends DepotRepository updatePartial(OOOUserRecord.getKey(userId), OOOUserRecord.EMAIL, email); } + /** + * Updates the specified user's email address and marks their account as unvalidated. + */ + public void changeEmailAndInvalidate (int userId, String email) + { + updatePartial(OOOUserRecord.getKey(userId), OOOUserRecord.EMAIL, email, + OOOUserRecord.FLAGS, OOOUserRecord.FLAGS.bitAnd(~OOOUser.VALIDATED_FLAG)); + } + /** * Updates the specified user's password (should already be encrypted). */ @@ -633,6 +642,24 @@ public class DepotUserRepository extends DepotRepository return true; } + /** + * Adds the supplied flags to the specified user's flags. + */ + public void addFlags (int userId, int addMask) + { + updatePartial(OOOUserRecord.getKey(userId), + OOOUserRecord.FLAGS, OOOUserRecord.FLAGS.bitOr(addMask)); + } + + /** + * Clears the supplied flags from the specified user's flags. + */ + public void clearFlags (int userId, int clearMask) + { + updatePartial(OOOUserRecord.getKey(userId), + OOOUserRecord.FLAGS, OOOUserRecord.FLAGS.bitAnd(~clearMask)); + } + /** * 'Delete' the users account such that they can no longer access it, however we do not delete * the record from the db. The name is changed such that the original name has XX=FOO if the