File IMAP-allow-creating-top-level-folders-if-User-namespace-is-empty.patch of Package kdepim4-runtime
From 580ef3441cdd9ca2555a2a00c54aaa97a26b43a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org>
Date: Fri, 2 Jun 2017 22:18:04 +0200
Subject: IMAP: allow creating top-level folders it User namespace is empty
If the server does not support namespaces or if the user namespace is empty
then allow creating sub-collections directly under the top-level collection.
BUG: 339567
FIXED-IN: 5.5.2
---
resources/imap/retrievecollectionstask.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/resources/imap/retrievecollectionstask.cpp b/resources/imap/retrievecollectionstask.cpp
index b29477b..0da8d3c 100644
--- a/resources/imap/retrievecollectionstask.cpp
+++ b/resources/imap/retrievecollectionstask.cpp
@@ -56,6 +56,13 @@ void RetrieveCollectionsTask::doStart( KIMAP::Session *session )
policy.setInheritFromParent( false );
policy.setSyncOnDemand( true );
+ // The first in the list of namespaces is User namespace
+ // If the user namespace is empty, then make it possible for user to create
+ // new folders as children of the root folder
+qDebug() << "Wolfi: User namespace is:" << serverNamespaces().value(0).name;
+ if (serverNamespaces().value(0).name.isEmpty()) {
+ root.setRights(Akonadi::Collection::CanCreateCollection); qDebug() << "Calling root.setRights(Akonadi::Collection::CanCreateCollection);";
+ }
QStringList localParts;
localParts << QLatin1String(Akonadi::MessagePart::Envelope)
<< QLatin1String(Akonadi::MessagePart::Header);
--
cgit v0.11.2