mirror of https://github.com/M66B/FairEmail.git
Added search logging
This commit is contained in:
parent
3641653cc9
commit
0ce1b9d1d4
|
@ -401,6 +401,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
|
|
||||||
if (protocol.supportsUtf8())
|
if (protocol.supportsUtf8())
|
||||||
try {
|
try {
|
||||||
|
EntityLog.log(context, "Search unicode criteria=" + criteria);
|
||||||
SearchTerm terms = criteria.getTerms(
|
SearchTerm terms = criteria.getTerms(
|
||||||
true,
|
true,
|
||||||
state.ifolder.getPermanentFlags(),
|
state.ifolder.getPermanentFlags(),
|
||||||
|
@ -413,6 +414,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
args.writeAtom("ALL");
|
args.writeAtom("ALL");
|
||||||
|
|
||||||
Response[] responses = protocol.command("SEARCH", args);
|
Response[] responses = protocol.command("SEARCH", args);
|
||||||
|
for (Response response : responses)
|
||||||
|
EntityLog.log(context, "Search unicode response=" + response);
|
||||||
if (responses.length == 0)
|
if (responses.length == 0)
|
||||||
throw new ProtocolException("No response");
|
throw new ProtocolException("No response");
|
||||||
if (!responses[responses.length - 1].isOK())
|
if (!responses[responses.length - 1].isOK())
|
||||||
|
@ -425,6 +428,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
while ((msgnum = response.readNumber()) != -1)
|
while ((msgnum = response.readNumber()) != -1)
|
||||||
msgnums.add(msgnum);
|
msgnums.add(msgnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EntityLog.log(context, "Search unicode messages=" + msgnums.size());
|
||||||
Message[] imessages = new Message[msgnums.size()];
|
Message[] imessages = new Message[msgnums.size()];
|
||||||
for (int i = 0; i < msgnums.size(); i++)
|
for (int i = 0; i < msgnums.size(); i++)
|
||||||
imessages[i] = state.ifolder.getMessage(msgnums.get(i));
|
imessages[i] = state.ifolder.getMessage(msgnums.get(i));
|
||||||
|
@ -437,13 +442,16 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
// Fallback to ASCII search
|
// Fallback to ASCII search
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EntityLog.log(context, "Search ASCII criteria=" + criteria);
|
||||||
SearchTerm terms = criteria.getTerms(
|
SearchTerm terms = criteria.getTerms(
|
||||||
false,
|
false,
|
||||||
state.ifolder.getPermanentFlags(),
|
state.ifolder.getPermanentFlags(),
|
||||||
browsable.keywords);
|
browsable.keywords);
|
||||||
if (terms == null)
|
if (terms == null)
|
||||||
return new Message[0];
|
return new Message[0];
|
||||||
return state.ifolder.search(terms);
|
Message[] messages = state.ifolder.search(terms);
|
||||||
|
EntityLog.log(context, "Search ASCII messages=" + (messages == null ? null : messages.length));
|
||||||
|
return messages;
|
||||||
}
|
}
|
||||||
} catch (MessagingException ex) {
|
} catch (MessagingException ex) {
|
||||||
ProtocolException pex = new ProtocolException(
|
ProtocolException pex = new ProtocolException(
|
||||||
|
|
Loading…
Reference in New Issue