imapflow 1.0.102 → 1.0.103
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/lib/commands/list.js +13 -13
- package/package.json +1 -1
package/lib/commands/list.js
CHANGED
|
@@ -42,13 +42,13 @@ module.exports = async (connection, reference, mailbox, options) => {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
if (listCommand === 'LIST' && connection.capabilities.has('LIST-STATUS') && statusQueryAttributes.length) {
|
|
46
|
+
returnArgs.push({ type: 'ATOM', value: 'STATUS' }, statusQueryAttributes);
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
let runList = async (reference, mailbox) => {
|
|
46
50
|
const cmdArgs = [encodePath(connection, reference), encodePath(connection, mailbox)];
|
|
47
51
|
|
|
48
|
-
if (listCommand === 'LIST' && connection.capabilities.has('LIST-STATUS') && statusQueryAttributes.length) {
|
|
49
|
-
returnArgs.push({ type: 'ATOM', value: 'STATUS' }, statusQueryAttributes);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
52
|
if (returnArgs.length) {
|
|
53
53
|
cmdArgs.push({ type: 'ATOM', value: 'RETURN' }, returnArgs);
|
|
54
54
|
}
|
|
@@ -165,6 +165,15 @@ module.exports = async (connection, reference, mailbox, options) => {
|
|
|
165
165
|
let normalizedReference = normalizePath(connection, reference || '');
|
|
166
166
|
await runList(normalizedReference, normalizePath(connection, mailbox || '', true));
|
|
167
167
|
|
|
168
|
+
if (options.listOnly) {
|
|
169
|
+
return entries;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (normalizedReference && !entries.find(entry => entry.specialUse === '\\Inbox')) {
|
|
173
|
+
// INBOX was most probably not included in the listing if namespace was used
|
|
174
|
+
await runList('', 'INBOX');
|
|
175
|
+
}
|
|
176
|
+
|
|
168
177
|
if (options.statusQuery) {
|
|
169
178
|
for (let entry of entries) {
|
|
170
179
|
if (!entry.flags.has('\\Noselect') && !entry.flags.has('\\NonExistent')) {
|
|
@@ -182,15 +191,6 @@ module.exports = async (connection, reference, mailbox, options) => {
|
|
|
182
191
|
}
|
|
183
192
|
}
|
|
184
193
|
|
|
185
|
-
if (options.listOnly) {
|
|
186
|
-
return entries;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (normalizedReference && !entries.find(entry => entry.specialUse === '\\Inbox')) {
|
|
190
|
-
// INBOX was most probably not included in the listing if namespace was used
|
|
191
|
-
await runList('', 'INBOX');
|
|
192
|
-
}
|
|
193
|
-
|
|
194
194
|
response = await connection.exec(
|
|
195
195
|
'LSUB',
|
|
196
196
|
[encodePath(connection, normalizePath(connection, reference || '')), encodePath(connection, normalizePath(connection, mailbox || '', true))],
|