int oldflags = rs.getInt("flags_");
if (oldflags==flags) return;
Log.info(this, "setflags (old="+oldflags+")" + "update mail set flags_="+(flags)+" where uid_="+uid()+"");
+ if ((flags & Mailbox.Flag.DELETED) != 0) Log.printStackTrace("deletion", Log.WARN);
PreparedStatement update = conn.prepareStatement("update mail set flags_=? where uid_=?");
update.setInt(1, flags);
update.setInt(2, uid());
}
public int imapNumber() {
if ("".equals(whereClause)) return count;
- try {
- ResultSet rs = conn.prepareStatement("select count(*) from mail where uid_ <= " + uid()).executeQuery();
- rs.next();
- return rs.getInt(1);
- } catch (Exception e) { throw new RuntimeException(e); }
+ try { return queryImapNumberCache(uid()); } catch (SQLException s) { throw new RuntimeException(s); }
}
public int nntpNumber() { return uid(); }
public void delete() {