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-04 21:05:05 (GMT)
commit3ec500eaf64af6bde445f0c7d397fde5a824c6d5 (patch)
tree8ac9faa1b3f3e892ba558b2db5936e10fad82f15
parent5d6379218cb81cb4386170ad40473830c792fd03 (diff)
downloadkolab-utils-3ec500eaf64af6bde445f0c7d397fde5a824c6d5.tar.gz
Use /shared prefix when fetching annotations using METADATA.
-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)) {