routes of update flags with imap
This commit is contained in:
@@ -34,6 +34,12 @@ export async function getMessageIdOnUid(uid: number): Promise<{ message_id: numb
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function getMessageUid(messageId: number): Promise<{uid: number}[]> {
|
||||
const query = `SELECT uid FROM mailbox_message WHERE message_id = ?`;
|
||||
const values = [messageId];
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function findRoomByOwner(ownerId: number): Promise<{ room_id: number }[]> {
|
||||
const query = `SELECT room_id FROM app_room WHERE owner_id = ?`;
|
||||
const values = [ownerId];
|
||||
@@ -50,3 +56,15 @@ export async function getUserIdOfMailbox(boxId: number): Promise<{ user_id: numb
|
||||
const values = [boxId];
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
export async function getUserOfMailbox(mailboxId: number): Promise<{ user: string }[]> {
|
||||
const query = `
|
||||
SELECT address.email AS user
|
||||
FROM mailbox
|
||||
INNER JOIN app_account ON app_account.account_id = mailbox.account_id
|
||||
INNER JOIN address on address.address_id = app_account.user_id
|
||||
WHERE mailbox.mailbox_id = ?
|
||||
`;
|
||||
const values = [mailboxId];
|
||||
return await execQueryAsync(query, values);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user