mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 19:52:17 -05:00
Issue 624
Don't bother going to server while creating an ImapMessage from a UID
This commit is contained in:
parent
0b33462ade
commit
b4b1b081a7
@ -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,32 +585,8 @@ 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Message[] getMessages(int start, int end, MessageRetrievalListener listener)
|
||||
|
Loading…
Reference in New Issue
Block a user