diff --git a/.gitignore b/.gitignore index adfbcae..4ae1d76 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,5 @@ log* tmp test.* *.png -!*/schemas/* \ No newline at end of file +!*/schemas/* +todo \ No newline at end of file diff --git a/back/db/structureV2.sql b/back/db/database.sql similarity index 100% rename from back/db/structureV2.sql rename to back/db/database.sql diff --git a/back/mails/imap/Mailbox.ts b/back/mails/imap/Mailbox.ts index 3f95f53..22e9ba6 100644 --- a/back/mails/imap/Mailbox.ts +++ b/back/mails/imap/Mailbox.ts @@ -1,4 +1,4 @@ -import Imap, { ImapMessageAttributes, Box } from "imap"; +import Imap, { Box } from "imap"; import { getMailbox, getMailboxModseq, updateMailbox, updateMailboxModseq } from "../../db/imap/imap-db"; import { Attrs, AttrsWithEnvelope } from "../../interfaces/mail/attrs.interface"; import logger from "../../system/Logger"; @@ -35,6 +35,7 @@ export default class Mailbox { this.box = (await getMailbox(this.id))[0]; const isReadOnly = false; this.imap.openBox(this.boxName, isReadOnly, (err, box) => { + console.log(typeof(box.highestmodseq)) if (err) logger.err(err); // sync messages and flags @@ -62,7 +63,7 @@ export default class Mailbox { async updateModseq(newModseq: number) { updateMailboxModseq(this.id, newModseq).then(() => { - this.box.highestmodseq = newModseq; + this.box.highestmodseq = newModseq.toString(); }); } @@ -76,7 +77,7 @@ export default class Mailbox { // sync flags const lastModseq = (await getMailboxModseq(this.id))[0]?.modseq ?? 0; - if (box.highestmodseq > lastModseq) { + if (parseInt(box.highestmodseq) > lastModseq) { const fetchStream = this.imap.fetch("1:*", { bodies: "", modifiers: { changedsince: lastModseq } }); fetchStream.on("message", (message) => { message.once("attributes", (attrs) => { @@ -93,7 +94,7 @@ export default class Mailbox { } else { logger.log("Flags already up to date") } - this.updateModseq(box.highestmodseq); + this.updateModseq(parseInt(box.highestmodseq)); } async syncMail(savedUid: number, currentUid: number) { diff --git a/front/src/components/structure/message/Options.vue b/front/src/components/structure/message/Options.vue index 85b59cb..5e7c2eb 100644 --- a/front/src/components/structure/message/Options.vue +++ b/front/src/components/structure/message/Options.vue @@ -69,6 +69,7 @@ const setFlag = (flag: string, loadingState: Ref) => { class="option" :loading="flaggedLoading" :classes="hasFlag(props.msg?.flags, '\\Flagged') ? 'warn' : ''" + v-tooltip="hasFlag(props.msg?.flags, '\\Flagged') ? 'Unflag' : 'Flag'" />