@5minds/node-red-contrib-processcube-tools 1.1.0 → 1.2.0-develop-2eb127-mg68t7xt
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.
|
@@ -112,6 +112,7 @@ module.exports = function (RED) {
|
|
|
112
112
|
const state = {
|
|
113
113
|
totalFolders: folders.length,
|
|
114
114
|
processedFolders: 0,
|
|
115
|
+
folderCount: {},
|
|
115
116
|
successes: 0,
|
|
116
117
|
failures: 0,
|
|
117
118
|
totalMails: 0,
|
|
@@ -168,6 +169,7 @@ module.exports = function (RED) {
|
|
|
168
169
|
payload: {
|
|
169
170
|
status: 'success',
|
|
170
171
|
total: state.totalMails,
|
|
172
|
+
folderCount: state.folderCount,
|
|
171
173
|
folders: folders.join(', '),
|
|
172
174
|
}
|
|
173
175
|
}]);
|
|
@@ -190,6 +192,8 @@ module.exports = function (RED) {
|
|
|
190
192
|
return startNextFolder();
|
|
191
193
|
}
|
|
192
194
|
|
|
195
|
+
state.folderCount[folder] = 0;
|
|
196
|
+
|
|
193
197
|
imap.search(['UNSEEN'], (err, results) => {
|
|
194
198
|
if (err) {
|
|
195
199
|
node.error(`Search failed in folder "${folder}": ${err.message}`);
|
|
@@ -236,6 +240,7 @@ module.exports = function (RED) {
|
|
|
236
240
|
content: att.content,
|
|
237
241
|
})),
|
|
238
242
|
};
|
|
243
|
+
state.folderCount[folder] = (state.folderCount[folder] || 0) + 1;
|
|
239
244
|
onMail(outMsg);
|
|
240
245
|
});
|
|
241
246
|
});
|