@bobfrankston/rmfmail 1.2.224 → 1.2.225

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6649,8 +6649,21 @@ ${bodyEncoded}`;
6649
6649
  return this.notImpl("openAttachment");
6650
6650
  }
6651
6651
  // Spam / abuse
6652
- async markAsSpamMessages(_accountId, _uids) {
6653
- return this.notImpl("markAsSpamMessages");
6652
+ /** Mark as spam = move to the account's \Junk folder, exactly as desktop's
6653
+ * MailxService.markAsSpamMessages does. This was a notImpl() stub, which
6654
+ * is worse than it sounds: the client optimistically removes the rows
6655
+ * from the list BEFORE calling this, then only writes the rejection to
6656
+ * the status bar. So on Android the spam button looked like it worked,
6657
+ * nothing moved on the server, and the next sync brought every message
6658
+ * straight back (Bob 2026-08-07: "attempts to delete spam but they keep
6659
+ * coming back"). moveMessages was implemented all along — spam just never
6660
+ * got wired to it. */
6661
+ async markAsSpamMessages(accountId, uids) {
6662
+ const target = this.db.getFolders(accountId).find((f) => f.specialUse === "junk");
6663
+ if (!target)
6664
+ throw new Error(`No \\Junk/\\Spam folder found for ${accountId}`);
6665
+ await this.moveMessages(accountId, uids, target.id);
6666
+ return { targetFolderId: target.id, moved: uids.length };
6654
6667
  }
6655
6668
  async recordSpamReport(_accountId, _uid, _folderId) {
6656
6669
  return this.notImpl("recordSpamReport");