summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-11-04 21:05:05 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-11-14 09:23:17 (GMT)
commit1bc8d12414f1e32cbaed78104630cd532f12e8df (patch)
treed50aea82f99ab81afa8efbecf6cc8965edc84fc6
parentcb014dcb9154a1ec266e2145864a3099864eddbf (diff)
downloadkolab-utils-kolab-utils-3.0.tar.gz
Use /shared prefix when fetching annotations using METADATA.kolab-utils-3.0
(cherry picked from commit 3ec500eaf64af6bde445f0c7d397fde5a824c6d5)
-rw-r--r--lib/jobs/findkolabfoldersjob.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/jobs/findkolabfoldersjob.cpp b/lib/jobs/findkolabfoldersjob.cpp
index cda3ca5..fb6b873 100644
--- a/lib/jobs/findkolabfoldersjob.cpp
+++ b/lib/jobs/findkolabfoldersjob.cpp
@@ -82,7 +82,8 @@ void FindKolabFoldersJob::onMailBoxesReceived( const QList< KIMAP::MailBoxDescri
meta->setMailBox( descriptor.name );
if ( m_serverCapabilities.contains( "METADATA" ) ) {
meta->setServerCapability( KIMAP::MetaDataJobBase::Metadata );
- meta->addEntry( KOLAB_FOLDER_TYPE_ANNOTATION );
+ //TODO support shared/private
+ meta->addEntry( "/shared" KOLAB_FOLDER_TYPE_ANNOTATION );
} else if ( m_serverCapabilities.contains( "ANNOTATEMORE" ) ) {
meta->setServerCapability( KIMAP::MetaDataJobBase::Annotatemore );
meta->addEntry( KOLAB_FOLDER_TYPE_ANNOTATION, "value.shared" );
@@ -124,18 +125,16 @@ void FindKolabFoldersJob::onGetMetaDataDone( KJob *job )
QMap<QByteArray, QMap<QByteArray, QByteArray> > rawAnnotations = meta->allMetaData( meta->mailBox() );
QByteArray attribute = "";
+ QByteArray annotation = KOLAB_FOLDER_TYPE_ANNOTATION;
if ( meta->serverCapability()==KIMAP::MetaDataJobBase::Annotatemore ) {
attribute = "value.shared";
}
-
-// QMap<QByteArray, QByteArray> annotations;
-// foreach ( const QByteArray &entry, rawAnnotations.keys() ) {
-// annotations[entry] = rawAnnotations[entry][attribute];
-// Debug() << entry << annotations[entry];
-// }
+ if ( meta->serverCapability()==KIMAP::MetaDataJobBase::Metadata ) {
+ annotation = "/shared" KOLAB_FOLDER_TYPE_ANNOTATION;
+ }
//TODO default flag?
- const QByteArray &kolabType = rawAnnotations[KOLAB_FOLDER_TYPE_ANNOTATION][attribute];
+ const QByteArray &kolabType = rawAnnotations[annotation][attribute];
// Debug() << meta->mailBox() << kolabType;
if (!kolabType.isEmpty()) {
if (kolabType.contains(KOLAB_FOLDER_TYPE_CONTACT)) {