Simplication

pull/194/merge
M66B 3 years ago
parent 2589deb2ed
commit 1cb818d741

@ -2969,7 +2969,8 @@ class Core {
private static void onSynchronizeMessages( private static void onSynchronizeMessages(
Context context, JSONArray jargs, Context context, JSONArray jargs,
EntityAccount account, final EntityFolder folder, EntityAccount account, final EntityFolder folder,
IMAPStore istore, final IMAPFolder ifolder, State state) throws JSONException, MessagingException, IOException { IMAPStore istore, final IMAPFolder ifolder, State state)
throws JSONException, ProtocolException, MessagingException, IOException {
final DB db = DB.getInstance(context); final DB db = DB.getInstance(context);
try { try {
SyncStats stats = new SyncStats(); SyncStats stats = new SyncStats();
@ -3231,12 +3232,8 @@ class Core {
long getuid = SystemClock.elapsedRealtime(); long getuid = SystemClock.elapsedRealtime();
MessagingException ex = (MessagingException) ifolder.doCommand(new IMAPFolder.ProtocolCommand() { MessagingException ex = (MessagingException) ifolder.doCommand(new IMAPFolder.ProtocolCommand() {
@Override @Override
public Object doCommand(IMAPProtocol protocol) { public Object doCommand(IMAPProtocol protocol) throws ProtocolException {
try { protocol.select(folder.name);
protocol.select(folder.name);
} catch (ProtocolException ex) {
return new MessagingException("UID FETCH", ex);
}
// Build ranges // Build ranges
List<Pair<Long, Long>> ranges = new ArrayList<>(); List<Pair<Long, Long>> ranges = new ArrayList<>();
@ -3337,10 +3334,10 @@ class Core {
if (response.isBYE()) if (response.isBYE())
return new MessagingException("UID FETCH", new IOException(response.toString())); return new MessagingException("UID FETCH", new IOException(response.toString()));
else if (response.isNO()) else if (response.isNO())
return new CommandFailedException(response); throw new CommandFailedException(response);
else if (response.isBAD()) else if (response.isBAD())
return new BadCommandException(response); throw new BadCommandException(response);
return new MessagingException("UID FETCH failed"); throw new ProtocolException("UID FETCH failed");
} }
} }

Loading…
Cancel
Save