зеркало из https://github.com/mozilla/pjs.git
bug 348798 - Removes braces in uuids. Patch by Bruno Browning <browning@uwalumni.com>, r1=jminta, r2=dmose
This commit is contained in:
Родитель
4ad135f56d
Коммит
0ccd37064d
|
@ -136,7 +136,9 @@ function getUUID() {
|
|||
if ("@mozilla.org/uuid-generator;1" in Components.classes) {
|
||||
var uuidGen = Cc["@mozilla.org/uuid-generator;1"].
|
||||
getService(Ci.nsIUUIDGenerator);
|
||||
return uuidGen.generateUUID().toString();
|
||||
// generate uuids without braces to avoid problems with
|
||||
// CalDAV servers that don't support filenames with {}
|
||||
return uuidGen.generateUUID().toString().replace(/[{}]/g, '');
|
||||
}
|
||||
// No uuid service (we're on the 1.8.0 branch)
|
||||
return "uuid" + (new Date()).getTime();
|
||||
|
@ -239,4 +241,4 @@ function ASSERT(aCondition, aMessage, aCritical) {
|
|||
} else {
|
||||
Components.utils.reportError(string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,10 +196,8 @@ calDavCalendar.prototype = {
|
|||
throw Components.interfaces.calIErrors.CAL_IS_READONLY;
|
||||
}
|
||||
|
||||
// CalDAV UIDs are used to construct filenames, so we strip braces to avoid
|
||||
// problems with servers which do not support names with {}
|
||||
if (aItem.id == null && aItem.isMutable)
|
||||
aItem.id = getUUID().replace(/[{}]/g, '');
|
||||
aItem.id = getUUID();
|
||||
|
||||
if (aItem.id == null) {
|
||||
if (aListener)
|
||||
|
@ -903,7 +901,7 @@ var calDavCalendarModule = {
|
|||
mContractID: "@mozilla.org/calendar/calendar;1?type=caldav",
|
||||
|
||||
mUtilsLoaded: false,
|
||||
loadUtils: function storageLoadUtils() {
|
||||
loadUtils: function caldavLoadUtils() {
|
||||
if (this.mUtilsLoaded)
|
||||
return;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче