aboutsummaryrefslogtreecommitdiffstats
path: root/src/messaging/IMAPFolder.cpp
diff options
context:
space:
mode:
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);
+ }
+ }
}