diff options
author | Vincent Richard <[email protected]> | 2004-12-22 11:01:17 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2004-12-22 11:01:17 +0000 |
commit | a4251085d24e870104e1b3bf76c66ba71a69a78b (patch) | |
tree | ca878fe9d1f418724a8a20c09e2ee84e6297021a /src/messaging/IMAPFolder.cpp | |
parent | Notify direct and indirect sub-folders when renaming an IMAP folder. (diff) | |
download | vmime-a4251085d24e870104e1b3bf76c66ba71a69a78b.tar.gz vmime-a4251085d24e870104e1b3bf76c66ba71a69a78b.zip |
Done rename() operation on 'maildir' + fixed some bugs/limitations in maildir/IMAP.
Diffstat (limited to 'src/messaging/IMAPFolder.cpp')
-rw-r--r-- | src/messaging/IMAPFolder.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/messaging/IMAPFolder.cpp b/src/messaging/IMAPFolder.cpp index 5ae268a2..4a3cc5fb 100644 --- a/src/messaging/IMAPFolder.cpp +++ b/src/messaging/IMAPFolder.cpp @@ -323,6 +323,8 @@ void IMAPFolder::create(const int type) throw exceptions::illegal_state("Folder is open"); else if (exists()) throw exceptions::illegal_state("Folder already exists"); + else if (!m_store->isValidFolderName(m_name)) + throw exceptions::invalid_folder_name(); // Emit the "CREATE" command // @@ -1258,10 +1260,12 @@ void IMAPFolder::rename(const folder::path& newPath) { if (!m_store) throw exceptions::illegal_state("Store disconnected"); - else if (isOpen()) - throw exceptions::illegal_state("Folder open"); + else if (m_path.isEmpty() || newPath.isEmpty()) + throw exceptions::illegal_operation("Cannot rename root folder"); else if (m_path.getSize() == 1 && m_name.getBuffer() == "INBOX") throw exceptions::illegal_operation("Cannot rename 'INBOX' folder"); + else if (!m_store->isValidFolderName(newPath.getLastComponent())) + throw exceptions::invalid_folder_name(); // Build the request text std::ostringstream command; |