sync flags on server start
This commit is contained in:
@@ -16,26 +16,38 @@ export async function getAllAccounts() {
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function getAllMailboxes(accountId) {
|
||||
const query = 'SELECT * FROM mailbox WHERE mailbox.account_id = ?';
|
||||
export async function getAllMailboxes(accountId: number) {
|
||||
const query = "SELECT * FROM mailbox WHERE mailbox.account_id = ?";
|
||||
const values = [accountId];
|
||||
return await execQueryAsync(query, values)
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function registerMailbox(accountId, mailboxName) {
|
||||
export async function registerMailbox(accountId: number, mailboxName: string) {
|
||||
const query = `INSERT INTO mailbox (account_id, mailbox_name) VALUES (?, ?)`;
|
||||
const values = [accountId, mailboxName];
|
||||
return await execQueryAsyncWithId(query, values);
|
||||
}
|
||||
|
||||
export async function getMailbox(mailboxId) {
|
||||
export async function getMailbox(mailboxId: number) {
|
||||
const query = `SELECT * FROM mailbox WHERE mailbox_id = ?`;
|
||||
const values = [mailboxId];
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export function updateMailbox(mailboxId, uidnext) {
|
||||
export function updateMailbox(mailboxId: number, uidnext: number) {
|
||||
const query = `UPDATE mailbox SET uidnext = ? WHERE mailbox_id = ?`;
|
||||
const values = [uidnext, mailboxId];
|
||||
execQuery(query, values);
|
||||
}
|
||||
}
|
||||
|
||||
export async function updateMailboxModseq(mailboxId: number, modseq: number) {
|
||||
const query = `UPDATE mailbox SET nextmodseq = ? WHERE mailbox_id = ?`;
|
||||
const values = [modseq, mailboxId];
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function getMailboxModseq(mailboxId: number): Promise<{ modseq: number }[]> {
|
||||
const query = `SELECT nextmodseq AS modseq FROM mailbox WHERE mailbox_id = ?`;
|
||||
const values = [mailboxId];
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user