fix: resolve context menu submenu and move-to-folder issues (#19)

This commit is contained in:
Matthieu MALVACHE
2026-03-02 09:10:03 +01:00
committed by Matthieu MALVACHE
parent 92620fb790
commit 58b9b70871
8 changed files with 216 additions and 182 deletions
+9 -3
View File
@@ -681,10 +681,11 @@ export class JMAPClient {
]);
}
async moveEmail(emailId: string, toMailboxId: string): Promise<void> {
await this.request([
async moveEmail(emailId: string, toMailboxId: string, accountId?: string): Promise<void> {
const targetAccountId = accountId || this.accountId;
const response = await this.request([
["Email/set", {
accountId: this.accountId,
accountId: targetAccountId,
update: {
[emailId]: {
mailboxIds: { [toMailboxId]: true },
@@ -692,6 +693,11 @@ export class JMAPClient {
},
}, "0"],
]);
const result = response.methodResponses?.[0]?.[1];
if (result?.notUpdated?.[emailId]) {
throw new Error(`Failed to move email: ${result.notUpdated[emailId].type || 'unknown error'}`);
}
}
async markAsSpam(emailId: string, accountId?: string): Promise<void> {