aboutsummaryrefslogtreecommitdiffstats
path: root/src/messaging/imap/IMAPFolder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/messaging/imap/IMAPFolder.cpp')
-rw-r--r--src/messaging/imap/IMAPFolder.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/messaging/imap/IMAPFolder.cpp b/src/messaging/imap/IMAPFolder.cpp
index 91bf0177..35f3509b 100644
--- a/src/messaging/imap/IMAPFolder.cpp
+++ b/src/messaging/imap/IMAPFolder.cpp
@@ -522,13 +522,24 @@ std::vector <folder*> IMAPFolder::getFolders(const bool recursive)
std::ostringstream oss;
oss << "LIST ";
- oss << IMAPUtils::quoteString
- (IMAPUtils::pathToString(m_connection->hierarchySeparator(), getFullPath()));
+
+ const string pathString = IMAPUtils::pathToString
+ (m_connection->hierarchySeparator(), getFullPath());
if (recursive)
+ {
+ oss << IMAPUtils::quoteString(pathString);
oss << " *";
+ }
else
+ {
+ if (pathString.empty()) // don't add sep for root folder
+ oss << "\"\"";
+ else
+ oss << IMAPUtils::quoteString(pathString + m_connection->hierarchySeparator());
+
oss << " %";
+ }
m_connection->send(true, oss.str(), true);