summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-11-17 19:52:04 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-11-26 08:39:24 (GMT)
commit4e95e27ead9b059c1fed4241ad7258f08b8f97b1 (patch)
tree1a3f140c361e2383dccd1917858b8fbf0a0811b0
parentcd2e03138691d4e7a7e08b12f438f4a80cc7c513 (diff)
downloadlibkolab-4e95e27ead9b059c1fed4241ad7258f08b8f97b1.tar.gz
Detect if the version is explicitly set to version 2.0.
Apparently some roundcube versions generate such headers. Patch contributed by David Faure.
-rw-r--r--kolabformat/kolabdefinitions.h1
-rw-r--r--kolabformat/kolabobject.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/kolabformat/kolabdefinitions.h b/kolabformat/kolabdefinitions.h
index 4169aa1..6bde0c2 100644
--- a/kolabformat/kolabdefinitions.h
+++ b/kolabformat/kolabdefinitions.h
@@ -43,6 +43,7 @@ namespace Kolab {
#define X_KOLAB_TYPE_HEADER "X-Kolab-Type"
#define X_KOLAB_MIME_VERSION_HEADER "X-Kolab-Mime-Version"
#define X_KOLAB_MIME_VERSION_HEADER_COMPAT "X-Kolab-Version"
+#define KOLAB_VERSION_V2 "2.0"
#define KOLAB_VERSION_V3 "3.0"
#define KOLAB_OBJECT_FILENAME "kolab.xml"
diff --git a/kolabformat/kolabobject.cpp b/kolabformat/kolabobject.cpp
index 9feffb6..c5ff391 100644
--- a/kolabformat/kolabobject.cpp
+++ b/kolabformat/kolabobject.cpp
@@ -378,7 +378,7 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
//For backwards compatibility to development versions, can be removed in future versions
xKolabVersion = msg->getHeaderByType(X_KOLAB_MIME_VERSION_HEADER_COMPAT);
}
- if (!xKolabVersion) {
+ if (!xKolabVersion || xKolabVersion->asUnicodeString() == KOLAB_VERSION_V2) {
d->mVersion = KolabV2;
} else {
if (xKolabVersion->asUnicodeString() != KOLAB_VERSION_V3) { //TODO version compatibility check?