Simplication

This commit is contained in:
M66B 2022-01-14 10:49:47 +01:00
parent 2589deb2ed
commit 1cb818d741
1 changed files with 7 additions and 10 deletions

View File

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