Issue 624
Don't bother going to server while creating an ImapMessage from a UID
This commit is contained in:
parent
0b33462ade
commit
b4b1b081a7
2 changed files with 1 additions and 27 deletions
|
@ -1380,8 +1380,6 @@ public class MessagingController implements Runnable {
|
|||
|
||||
Message remoteMessage = null;
|
||||
if (!uid.startsWith(Email.LOCAL_UID_PREFIX)) {
|
||||
// Why bother with this, perhaps just pass the UID to the store to save a roundtrip? And check for error returns, of course
|
||||
// Same applies for deletion
|
||||
remoteMessage = remoteSrcFolder.getMessage(uid);
|
||||
}
|
||||
if (remoteMessage == null) {
|
||||
|
|
|
@ -585,31 +585,7 @@ public class ImapStore extends Store {
|
|||
|
||||
@Override
|
||||
public Message getMessage(String uid) throws MessagingException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
try {
|
||||
List<ImapResponse> responses =
|
||||
executeSimpleCommand(String.format("UID SEARCH UID %S", uid));
|
||||
for (ImapResponse response : responses) {
|
||||
// Log.d(Email.LOG_TAG, "Got search response: " + response.get(0) + ", size " + response.size());
|
||||
if (response.mTag == null && response.get(0).equals("SEARCH")) {
|
||||
for (int i = 1, count = response.size(); i < count; i++) {
|
||||
if (uid.equals(response.get(i))) {
|
||||
return new ImapMessage(uid, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MessagingException me) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (IOException ioe) {
|
||||
throw ioExceptionHandler(mConnection, ioe);
|
||||
}
|
||||
return null;
|
||||
return new ImapMessage(uid, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue