summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorniko <niko>2012-08-03 07:28:16 (GMT)
committerniko <niko>2012-08-03 07:28:16 (GMT)
commitc63a72f5290d346036b8896e2cbc9974455cd880 (patch)
tree40edee8f10271f1b66b4c68e4bd598710e103a70
parent63a979bf4697064f475a34199f2df4d6a8fe123c (diff)
downloadsynckolab-c63a72f5290d346036b8896e2cbc9974455cd880.tar.gz
fix for Europe bug
-rw-r--r--src/chrome/content/synckolab/calendar.js20
-rw-r--r--src/chrome/content/synckolab/calendarTools.js12
-rw-r--r--src/chrome/content/synckolab/tools.js2
3 files changed, 20 insertions, 14 deletions
diff --git a/src/chrome/content/synckolab/calendar.js b/src/chrome/content/synckolab/calendar.js
index 2374731..6335b58 100644
--- a/src/chrome/content/synckolab/calendar.js
+++ b/src/chrome/content/synckolab/calendar.js
@@ -185,9 +185,9 @@ com.synckolab.Calendar = {
calComp.addSubcomponent(cur.icalComponent);
if (cConfig.type === "task") {
- msg = com.synckolab.tools.generateMail(cur.id, cConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(cur.id, cConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
} else {
- msg = com.synckolab.tools.generateMail(cur.id, cConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(cur.id, cConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
}
}
@@ -252,9 +252,9 @@ com.synckolab.Calendar = {
calComp.addSubcomponent(cur.icalComponent);
if (cConfig.type === "task") {
- msg = com.synckolab.tools.generateMail(cur.id, cConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(cur.id, cConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
} else {
- msg = com.synckolab.tools.generateMail(cur.id, cConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(cur.id, cConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
}
}
@@ -815,9 +815,9 @@ com.synckolab.Calendar = {
calComp.addSubcomponent(tmpEventObj.icalComponent);
if (this.gConfig.type === "task") {
- msg = com.synckolab.tools.generateMail(newEvent.uid, this.gConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(newEvent.uid, this.gConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
} else {
- msg = com.synckolab.tools.generateMail(newEvent.uid, this.gConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(newEvent.uid, this.gConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
}
}
@@ -904,9 +904,9 @@ com.synckolab.Calendar = {
calComp.addSubcomponent(tmpEventObj.icalComponent);
if (this.gConfig.type === "task") {
- msg = com.synckolab.tools.generateMail(newEvent.uid, this.gConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(newEvent.uid, this.gConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
} else {
- msg = com.synckolab.tools.generateMail(newEvent.uid, this.gConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(newEvent.uid, this.gConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
}
}
@@ -1066,9 +1066,9 @@ com.synckolab.Calendar = {
calComp.addSubcomponent(cur.icalComponent);
if (this.gConfig.type === "task") {
- msg = com.synckolab.tools.generateMail(cur.id, this.gConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(cur.id, this.gConfig.email, "iCal", "text/todo", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
} else {
- msg = com.synckolab.tools.generateMail(cur.id, this.gConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.utf8.encode(calComp.serializeToICS()), null);
+ msg = com.synckolab.tools.generateMail(cur.id, this.gConfig.email, "iCal", "text/calendar", false, com.synckolab.tools.text.quoted.encode(calComp.serializeToICS()), null);
}
}
diff --git a/src/chrome/content/synckolab/calendarTools.js b/src/chrome/content/synckolab/calendarTools.js
index b54d9ab..bcedf20 100644
--- a/src/chrome/content/synckolab/calendarTools.js
+++ b/src/chrome/content/synckolab/calendarTools.js
@@ -63,8 +63,8 @@ com.synckolab.calendarTools = {
var homeCalendar = this.activeCalendarManager.createCalendar("storage", makeURL("moz-profile-calendar://"));
this.activeCalendarManager.registerCalendar(homeCalendar);
- var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
- .getService(Components.interfaces.nsIStringBundleService);
+ var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);
+
var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");
homeCalendar.name = props.GetStringFromName("homeCalendarName");
@@ -378,7 +378,13 @@ com.synckolab.calendarTools.message2json = function (fileContent, syncTasks) {
// for ical - use the way through the lightning decoder to json
var parsedEvent = null;
- fileContent = com.synckolab.tools.text.utf8.decode(com.synckolab.tools.text.quoted.decode(fileContent));
+ if(fileContent.indexof("=3D") !== -1) {
+ fileContent = com.synckolab.tools.text.quoted.decode(fileContent);
+ }
+ // sepcial fix for Europe bug
+ if (fileContent.indexOf("TZIDID=rope")) {
+ fileContent = fileContent.replace(/TZID=rope/g,"TZID=Europe");
+ }
// this.format === 'iCal'
parsedEvent = this.ical2event(fileContent, syncTasks);
diff --git a/src/chrome/content/synckolab/tools.js b/src/chrome/content/synckolab/tools.js
index d289ad4..676972f 100644
--- a/src/chrome/content/synckolab/tools.js
+++ b/src/chrome/content/synckolab/tools.js
@@ -483,7 +483,7 @@ stripMailHeader: function (skcontent) {
}
}
- // content might still be quotted printable... doublecheck
+ // content might still be quoted printable... doublecheck
// check if we have to decode quoted printable
if (skcontent.indexOf(" version=3D") !== -1 || skcontent.indexOf("TZID=3D")) // we know from the version (or in case of citadel from the tzid)
{