mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-25 23:21:50 -05:00
Get rid of the "Did not get proper search result" message. This helps with buggy IMAP servers that don't return an untagged SEARCH response if nothing was found. Other untagged responses are simply ignored.
Fixes Issue 907
This commit is contained in:
parent
1516127b09
commit
938317e700
@ -912,24 +912,22 @@ public class ImapStore extends Store
|
||||
ArrayList<Message> messages = new ArrayList<Message>();
|
||||
try
|
||||
{
|
||||
boolean gotSearchValues = false;
|
||||
ArrayList<Integer> uids = new ArrayList<Integer>();
|
||||
List<ImapResponse> responses = searcher.search(); //
|
||||
for (ImapResponse response : responses)
|
||||
{
|
||||
if (response.get(0).equals("SEARCH"))
|
||||
if (response.mTag == null)
|
||||
{
|
||||
gotSearchValues = true;
|
||||
for (int i = 1, count = response.size(); i < count; i++)
|
||||
if (response.get(0).equals("SEARCH"))
|
||||
{
|
||||
uids.add(Integer.parseInt(response.getString(i)));
|
||||
for (int i = 1, count = response.size(); i < count; i++)
|
||||
{
|
||||
uids.add(Integer.parseInt(response.getString(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gotSearchValues == false)
|
||||
{
|
||||
throw new MessagingException("Did not get proper search response");
|
||||
}
|
||||
|
||||
// Sort the uids in numerically ascending order
|
||||
Collections.sort(uids);
|
||||
for (int i = 0, count = uids.size(); i < count; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user