protected static TableRow sendInfo(Context context, String email,
boolean isRegister, boolean send) throws SQLException, IOException,
MessagingException, AuthorizeException
{
// See if a registration token already exists for this user
TableRow rd = DatabaseManager.findByUnique(context, "registrationdata",
"email", email);
// If it already exists, just re-issue it
if (rd == null)
{
rd = DatabaseManager.create(context, "RegistrationData");
rd.setColumn("token", Utils.generateHexKey());
// don't set expiration date any more
// rd.setColumn("expires", getDefaultExpirationDate());
rd.setColumn("email", email);
DatabaseManager.update(context, rd);
// This is a potential problem -- if we create the callback
// and then crash, registration will get SNAFU-ed.
// So FIRST leave some breadcrumbs
if (log.isDebugEnabled())
{
log.debug("Created callback "
+ rd.getIntColumn("registrationdata_id")
+ " with token " + rd.getStringColumn("token")
+ " with email \"" + email + "\"");
}
}
if (send)