|
|
|
@ -100,7 +100,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|
|
|
|
private final ExecutorService executor = Helper.getBackgroundExecutor(1, "boundary");
|
|
|
|
|
|
|
|
|
|
private static final int SEARCH_LIMIT_DEVICE = 1000;
|
|
|
|
|
private static final int SEARCH_LIMIT_SERVER = 250;
|
|
|
|
|
|
|
|
|
|
interface IBoundaryCallbackMessages {
|
|
|
|
|
void onLoading();
|
|
|
|
@ -621,6 +620,13 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
state.imessages = (Message[]) result;
|
|
|
|
|
} catch (MessagingException ex) {
|
|
|
|
|
if (ex.getCause() instanceof ProtocolException)
|
|
|
|
|
throw (ProtocolException) ex.getCause();
|
|
|
|
|
else
|
|
|
|
|
throw ex;
|
|
|
|
|
}
|
|
|
|
|
EntityLog.log(context, "Boundary found messages=" + state.imessages.length);
|
|
|
|
|
|
|
|
|
|
FetchProfile fp = new FetchProfile();
|
|
|
|
|
fp.add(UIDFolder.FetchProfileItem.UID);
|
|
|
|
@ -646,13 +652,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|
|
|
|
return Long.compare(d1 == null ? 0 : d1.getTime(), d2 == null ? 0 : d2.getTime());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} catch (MessagingException ex) {
|
|
|
|
|
if (ex.getCause() instanceof ProtocolException)
|
|
|
|
|
throw (ProtocolException) ex.getCause();
|
|
|
|
|
else
|
|
|
|
|
throw ex;
|
|
|
|
|
}
|
|
|
|
|
EntityLog.log(context, "Boundary found messages=" + state.imessages.length);
|
|
|
|
|
|
|
|
|
|
EntityLog.log(context, "Boundary sorted messages=" + state.imessages.length);
|
|
|
|
|
|
|
|
|
|
state.index = state.imessages.length - 1;
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
@ -782,7 +783,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|
|
|
|
throw new ProtocolException(responses[responses.length - 1]);
|
|
|
|
|
|
|
|
|
|
List<Integer> msgnums = new ArrayList<>();
|
|
|
|
|
for (int r = 0; r < Math.min(responses.length, SEARCH_LIMIT_SERVER); r++) {
|
|
|
|
|
for (int r = 0; r < responses.length; r++) {
|
|
|
|
|
IMAPResponse response = (IMAPResponse) responses[r];
|
|
|
|
|
if (response.keyEquals("SEARCH")) {
|
|
|
|
|
int msgnum;
|
|
|
|
|