https://issues.kolab.org/show_bug.cgi?id=4474
Ensure no files folder show up in kmail by connecting to server with a files folder created.
https://issues.kolab.org/show_bug.cgi?id=4474
Ensure no files folder show up in kmail by connecting to server with a files folder created.
rKPR kdepim-runtime | |||
rKPR811280ed55f6 Do not show file folder in email list. |
-> Can't reproduce: NEEDSINFO
What is the mimetype of the folder?
akonadiconsole -> browser -> right click to the file collection -> "folder properties" -> tab "Internals" -> List "Content Types"
annotation:
"mailbox" "annotations" "INBOX" QMap(("/private/vendor/kolab/folder-type", "mail.inbox")("/shared/vendor/kolab/folder-type", "mail")) "Files" QMap(("/private/vendor/kolab/folder-type", "file.default")("/shared/vendor/kolab/folder-type", ""))
the current behaviour is if a /shared annotation this is used. For "Files" this means isEmpty() -> use default type -> mail type [see KolabHelpers::getFolderTypeAnnotation (kdepim-runtime)]:
QByteArray KolabHelpers::getFolderTypeAnnotation(const QMap< QByteArray, QByteArray > &annotations) { if (annotations.contains("/shared" KOLAB_FOLDER_TYPE_ANNOTATION)) { return annotations.value( "/shared" KOLAB_FOLDER_TYPE_ANNOTATION); } return annotations.value(KOLAB_FOLDER_TYPE_ANNOTATION); }
The emtpy annotation is a bug possibly in kolabd or so (whoever create the folder with that annotation)
That said, we can work around it by ignoring empty annotations.
getFolderTypeAnnotation should:
....
getFolderTypeAnnotation should:
- ignore empty annotations
- private overrides shared annotations
- A folder with an unknown annotation shouldn't fall-back to mail, it should be ignored instead.
The last point doesn't apply to getFolderTypeAnnotation. isHandledType should already correctly ignore unknown folder types, so I'm not sure why it's recognized as a mail folder.
getFolderTypeAnnotation should continue to return annotations.value(KOLAB_FOLDER_TYPE_ANNOTATION); (without shared or private), for backwards compatibility. But only if no
shared or private annotation is found.
The reason is that folderTypeFromString in libkolab returns type mail for empty annotations. We can't change this because an empty string in this context means no annotation,
and for that case mail is correct. folderTypeFromString must only be called with valid annotations (or an empty string if there is no annotation). the kolab resource therefore
needs to avoid using folderTypeFromString in case of an empty annotation.
We deiscussed and cam to the conclusion:
getFolderTypeAnnotation should:
"Spam" QMap(("/private/vendor/kolab/folder-type", "mail.junkemail")("/shared/vendor/kolab/folder-type", "")) "Drafts" QMap(("/private/vendor/kolab/folder-type", "mail.drafts")("/shared/vendor/kolab/folder-type", ""))
folderTypeFromString:
roundcubemail fixes the shared annotation:
before (wrong):
"Files" QMap(("/private/vendor/kolab/folder-type", "file.default")("/shared/vendor/kolab/folder-type", ""))
"Files" QMap(("/private/vendor/kolab/folder-type", "file.default")("/shared/vendor/kolab/folder-type", "file"))
Can be reproduced using the docker images kontact:latest against kolab/kolabtestcontainer