aboutsummaryrefslogtreecommitdiffstats
path: root/src/messaging/IMAPFolder.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2004-12-22 09:07:05 +0000
committerVincent Richard <[email protected]>2004-12-22 09:07:05 +0000
commitbf3b1d9dc903453c8aef3449d3d02010b7f1e523 (patch)
tree21558abe2f5420062967ebb8f716ba54e3396a0d /src/messaging/IMAPFolder.cpp
parentTypo in function doc. (diff)
downloadvmime-bf3b1d9dc903453c8aef3449d3d02010b7f1e523.tar.gz
vmime-bf3b1d9dc903453c8aef3449d3d02010b7f1e523.zip
Notification when renaming IMAP folder.
Diffstat (limited to 'src/messaging/IMAPFolder.cpp')
-rw-r--r--src/messaging/IMAPFolder.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/messaging/IMAPFolder.cpp b/src/messaging/IMAPFolder.cpp
index a3c83c77..9ca55fc6 100644
--- a/src/messaging/IMAPFolder.cpp
+++ b/src/messaging/IMAPFolder.cpp
@@ -1292,6 +1292,20 @@ void IMAPFolder::rename(const folder::path& newPath)
events::folderEvent event(this, events::folderEvent::TYPE_RENAMED, oldPath, newPath);
notifyFolder(event);
+
+ // Notify folders with the same path
+ for (std::list <IMAPFolder*>::iterator it = m_store->m_folders.begin() ;
+ it != m_store->m_folders.end() ; ++it)
+ {
+ if ((*it) != this && (*it)->getFullPath() == oldPath)
+ {
+ (*it)->m_path = newPath;
+ (*it)->m_name = newPath.getLastComponent();
+
+ events::folderEvent event(*it, events::folderEvent::TYPE_RENAMED, oldPath, newPath);
+ (*it)->notifyFolder(event);
+ }
+ }
}