@bobfrankston/rmfmail 1.1.242 → 1.1.243

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.
@@ -6896,10 +6896,13 @@ Accept: application/json\r
6896
6896
  * `\Flagged` is the presence of STARRED. We always send both add and
6897
6897
  * remove so the end state matches regardless of what was there before,
6898
6898
  * which makes the call idempotent and safe to retry. */
6899
- async setFlags(folder, uid, flags) {
6900
- const query = `in:${this.folderToLabel(folder)}`;
6901
- const ids = await this.listMessageIds(query, 1e3);
6902
- const id = ids.find((id2) => idToUid(id2) === uid);
6899
+ async setFlags(folder, uid, flags, messageId) {
6900
+ let id = messageId;
6901
+ if (!id) {
6902
+ const query = `in:${this.folderToLabel(folder)}`;
6903
+ const ids = await this.listMessageIds(query, 1e3);
6904
+ id = ids.find((id2) => idToUid(id2) === uid);
6905
+ }
6903
6906
  if (!id)
6904
6907
  throw new Error(`Gmail setFlags: UID ${uid} not found in ${folder}`);
6905
6908
  const flagSet = new Set(flags);