summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/chrome/content/synckolab/addressbookTools.js22
-rw-r--r--test/synckolab/parser/kolab3/xml/list.test1.eml.xml3
2 files changed, 14 insertions, 11 deletions
diff --git a/src/chrome/content/synckolab/addressbookTools.js b/src/chrome/content/synckolab/addressbookTools.js
index 979288f..14760db 100644
--- a/src/chrome/content/synckolab/addressbookTools.js
+++ b/src/chrome/content/synckolab/addressbookTools.js
@@ -1301,24 +1301,22 @@ synckolab.addressbookTools.list2Pojo = function (card) {
* @param cards hashmap: a hashmap containing all cards (also json)
*/
synckolab.addressbookTools.list2Kolab3 = function (card, fields) {
- var xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ var xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n";
+ xml += "<vcards xmlns=\"urn:ietf:params:xml:ns:vcard-4.0\">\n";
xml += "<vcard>\n";
- xml += " <product-id>SyncKolab " + synckolab.config.version + ", Kolab resource</product-id>\n";
- xml += " <uid>" + this.getUID(card) + "</uid>\n";
- xml += " <creation-date>" + synckolab.tools.text.calDateTime2String(new Date(), false, true) + "</creation-date>\n";
- xml += " <last-modification-date>" + synckolab.tools.text.calDateTime2String(new Date(), false, true) + "</last-modification-date>\n";
+ xml += " <uid><text>" + this.getUID(card) + "</text></uid>\n";
+ xml += " <x-kolab-version><text>3.0dev1</text></x-kolab-version>\n";
+ xml += " <prodid><text>SyncKolab " + synckolab.config.version + ", Kolab resource</text></prodid>\n";
+ xml += " <rev><timestamp>" + synckolab.tools.text.calDateTime2String(new Date(), false, true) + "Z</timestamp></rev>\n";
xml += " <kind><text>group</text></kind>\n";
// default: public - tbird doesnt know of other types of list like private
xml += " <sensitivity>public</sensitivity>\n";
- xml += " <name>" + synckolab.tools.text.encode4XML(this.getCardProperty(card, "DisplayName")) + "</name>\n";
+ xml += " <fn><text>" + synckolab.tools.text.encode4XML(this.getCardProperty(card, "DisplayName")) + "</fn></name>\n";
- if (this.haveCardProperty(card, "Notes")) {
- xml += " <notes><text>" + synckolab.tools.text.encode4XML(this.getCardProperty(card, "Notes")) + "</text></notes>\n";
- }
if (this.haveCardProperty(card, "NickName")) {
- xml += " <nickname>" + synckolab.tools.text.encode4XML(this.getCardProperty(card, "NickName")) + "</nickname>\n";
+ xml += " <nickname><text>" + synckolab.tools.text.encode4XML(this.getCardProperty(card, "NickName")) + "</text></nickname>\n";
}
synckolab.tools.logMessage("going through child cards", synckolab.global.LOG_DEBUG + synckolab.global.LOG_AB);
@@ -1340,6 +1338,10 @@ synckolab.addressbookTools.list2Kolab3 = function (card, fields) {
xml += " </member>\n";
}
}
+
+ if (this.haveCardProperty(card, "Notes")) {
+ xml += " <note><text>" + synckolab.tools.text.encode4XML(this.getCardProperty(card, "Notes")) + "</text></note>\n";
+ }
xml += "</vcard>\n</vcards>\n";
synckolab.tools.logMessage("list: " + xml, synckolab.global.LOG_INFO + synckolab.global.LOG_AB);
diff --git a/test/synckolab/parser/kolab3/xml/list.test1.eml.xml b/test/synckolab/parser/kolab3/xml/list.test1.eml.xml
index 1d56829..464d2dd 100644
--- a/test/synckolab/parser/kolab3/xml/list.test1.eml.xml
+++ b/test/synckolab/parser/kolab3/xml/list.test1.eml.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+ <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
<vcard>
<uid><text>list_name</text></uid>
<x-kolab-version><text>3.0dev1</text></x-kolab-version>
@@ -7,7 +8,6 @@
<kind>
<text>group</text>
</kind>
- <note><text>list-description</text></note>
<fn><text>list-name</text></fn>
<nickname><text>list-nickname</text></nickname>
<member>
@@ -20,5 +20,6 @@
<email><text>weird@email.com</text></email>
<uid><urn>urn:uuid:pas-id-A4E937D838A897AD</urn></uid>
</member>
+ <note><text>list-description</text></note>
</vcard>
</vcards> \ No newline at end of file