Commit 367801d4 authored by Francisco Cunha's avatar Francisco Cunha Committed by Hussein

P4A-816 - listFolders() cleanup

parent 76f22a76
......@@ -162,11 +162,12 @@ public class ImapStore extends RemoteStore {
private Set<String> listFolders(ImapConnection connection, boolean subscribedOnly) throws IOException,
MessagingException {
String encodedListPrefix = ImapUtility.encodeString(getCombinedPrefix() + "*");
String commandResponse = subscribedOnly ? "LSUB" : "LIST";
List<ImapResponse> responses =
connection.executeSimpleCommand(String.format("%s \"\" %s", commandResponse,
ImapUtility.encodeString(getCombinedPrefix() + "*")));
List<ImapResponse> responses = connection.
executeSimpleCommand(String.format("%s \"\" %s", commandResponse, encodedListPrefix));
List<ListResponse> listResponses = (subscribedOnly) ?
ListResponse.parseLsub(responses) : ListResponse.parseList(responses);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment