|
|
|
@ -1029,9 +1029,12 @@ class Core {
|
|
|
|
|
MessagingException ex = (MessagingException) ifolder.doCommand(new IMAPFolder.ProtocolCommand() {
|
|
|
|
|
@Override
|
|
|
|
|
public Object doCommand(IMAPProtocol protocol) {
|
|
|
|
|
Log.i("Executing uid fetch count=" + uids.size());
|
|
|
|
|
Log.i(folder.name + " executing uid fetch count=" + uids.size());
|
|
|
|
|
List<List<Long>> chunked = Helper.chunkList(new ArrayList<>(uids), 25);
|
|
|
|
|
for (int c = 0; c < chunked.size(); c++) {
|
|
|
|
|
Log.i(folder.name + " chunk #" + c + " size=" + chunked.get(c).size());
|
|
|
|
|
Response[] responses = protocol.command(
|
|
|
|
|
"UID FETCH " + TextUtils.join(",", uids) + " (UID)", null);
|
|
|
|
|
"UID FETCH " + TextUtils.join(",", chunked.get(c)) + " (UID)", null);
|
|
|
|
|
|
|
|
|
|
if (responses.length > 0 && responses[responses.length - 1].isOK()) {
|
|
|
|
|
for (Response response : responses)
|
|
|
|
@ -1041,7 +1044,6 @@ class Core {
|
|
|
|
|
if (uid != null)
|
|
|
|
|
uids.remove(uid.uid);
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
for (Response response : responses)
|
|
|
|
|
if (response.isNO() || response.isBAD() || response.isBYE())
|
|
|
|
@ -1049,6 +1051,8 @@ class Core {
|
|
|
|
|
return new MessagingException("UID FETCH failed");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (ex != null)
|
|
|
|
|
throw ex;
|
|
|
|
|