imapflow 1.0.81 → 1.0.82
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.
- package/CHANGELOG.md +4 -0
- package/lib/imap-flow.js +25 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/imap-flow.js
CHANGED
|
@@ -942,11 +942,21 @@ class ImapFlow extends EventEmitter {
|
|
|
942
942
|
let seq = Number(untagged.command);
|
|
943
943
|
if (seq && seq <= this.mailbox.exists) {
|
|
944
944
|
this.mailbox.exists--;
|
|
945
|
-
|
|
945
|
+
let payload = {
|
|
946
946
|
path: this.mailbox.path,
|
|
947
947
|
seq,
|
|
948
948
|
vanished: false
|
|
949
|
-
}
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
if (typeof this.options.expungeHandler === 'function') {
|
|
952
|
+
try {
|
|
953
|
+
await this.options.expungeHandler(payload);
|
|
954
|
+
} catch (err) {
|
|
955
|
+
this.log.error({ msg: 'Failed to notify expunge event', payload, error: err, cid: this.id });
|
|
956
|
+
}
|
|
957
|
+
} else {
|
|
958
|
+
this.emit('expunge', payload);
|
|
959
|
+
}
|
|
950
960
|
}
|
|
951
961
|
}
|
|
952
962
|
|
|
@@ -970,13 +980,24 @@ class ImapFlow extends EventEmitter {
|
|
|
970
980
|
}
|
|
971
981
|
|
|
972
982
|
let uidList = expandRange(uids);
|
|
983
|
+
|
|
973
984
|
for (let uid of uidList) {
|
|
974
|
-
|
|
985
|
+
let payload = {
|
|
975
986
|
path: mailbox.path,
|
|
976
987
|
uid,
|
|
977
988
|
vanished: true,
|
|
978
989
|
earlier: tags.includes('EARLIER')
|
|
979
|
-
}
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
if (typeof this.options.expungeHandler === 'function') {
|
|
993
|
+
try {
|
|
994
|
+
await this.options.expungeHandler(payload);
|
|
995
|
+
} catch (err) {
|
|
996
|
+
this.log.error({ msg: 'Failed to notify expunge event', payload, error: err, cid: this.id });
|
|
997
|
+
}
|
|
998
|
+
} else {
|
|
999
|
+
this.emit('expunge', payload);
|
|
1000
|
+
}
|
|
980
1001
|
}
|
|
981
1002
|
}
|
|
982
1003
|
|