Skip to content

Commit

Permalink
fix: added exists optimization to GETQUOTAROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jun 26, 2024
1 parent 5c53b88 commit 1c8be9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpers/imap/on-get-quota-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

const Aliases = require('#models/aliases');
const Mailboxes = require('#models/mailboxes');
// const Mailboxes = require('#models/mailboxes');
const IMAPError = require('#helpers/imap-error');
const i18n = require('#helpers/i18n');
const refineAndLogError = require('#helpers/refine-and-log-error');
Expand Down Expand Up @@ -44,6 +44,7 @@ async function onGetQuotaRoot(path, session, fn) {
try {
await this.refreshSession(session, 'GETQUOTAROOT');

/*
const mailbox = await Mailboxes.findOne(this, session, {
path
});
Expand All @@ -55,11 +56,11 @@ async function onGetQuotaRoot(path, session, fn) {
imapResponse: 'NONEXISTENT'
}
);
*/

// TODO: if uids get out of order then this should trigger
// a reset perhaps maybe?

/*
const exists =
session.db
.prepare(`select exists(select 1 FROM "Mailboxes" WHERE "path" = ?)`)
Expand All @@ -73,7 +74,6 @@ async function onGetQuotaRoot(path, session, fn) {
imapResponse: 'NONEXISTENT'
}
);
*/

const { storageUsed, maxQuotaPerAlias } = await Aliases.isOverQuota(
{
Expand Down

0 comments on commit 1c8be9a

Please sign in to comment.