feat: implement keyword migration functionality and update related components

This commit is contained in:
Linus Rath
2026-03-21 01:58:48 +01:00
parent 2547c10060
commit 2d56cc9be9
6 changed files with 139 additions and 31 deletions
+12
View File
@@ -216,6 +216,18 @@ export class DemoJMAPClient implements IJMAPClient {
if (email) email.keywords = { ...email.keywords, ...keywords };
}
async migrateKeyword(oldKeyword: string, newKeyword: string): Promise<number> {
let count = 0;
for (const email of this.data.emails) {
if (email.keywords[oldKeyword]) {
delete email.keywords[oldKeyword];
email.keywords[newKeyword] = true;
count++;
}
}
return count;
}
async deleteEmail(emailId: string): Promise<void> {
this.data.emails = this.data.emails.filter(e => e.id !== emailId);
this.recalcMailboxCounts();