Bug 290530: add organizer support to calItemBase. r=dmose, NPOTB.
This commit is contained in:
Родитель
d0dfae6ab9
Коммит
776c3f6556
|
@ -164,6 +164,14 @@ interface calIItemBase : nsISupports
|
|||
// will not throw an error if you delete a property that doesn't exist
|
||||
void deleteProperty(in AString name);
|
||||
|
||||
/**
|
||||
* The organizer (originator) of the item. We will likely not
|
||||
* honour or preserve all fields in the calIAttendee passed around here.
|
||||
* A base class like calIPerson might be more appropriate here, if we ever
|
||||
* grow one.
|
||||
*/
|
||||
attribute calIAttendee organizer;
|
||||
|
||||
// The array returned here is not live; it will not reflect calls to
|
||||
// removeAttendee/addAttendee that follow the call to getAttendees.
|
||||
void getAttendees(out PRUint32 count,
|
||||
|
|
|
@ -76,6 +76,8 @@ calItemBase.prototype = {
|
|||
if (this.mAlarmTime)
|
||||
this.mAlarmTime.makeImmutable();
|
||||
|
||||
if (this.mOrganizer)
|
||||
this.mOrganizer.makeImmutable();
|
||||
for (var i = 0; i < this.mAttendees.length; i++)
|
||||
this.mAttendees[i].makeImmutable();
|
||||
this.mImmutable = true;
|
||||
|
@ -243,6 +245,16 @@ calItemBase.prototype = {
|
|||
this.mParent = v;
|
||||
},
|
||||
|
||||
mOrganizer: null,
|
||||
get organizer() {
|
||||
return this.mOrganizer;
|
||||
},
|
||||
|
||||
set organizer(v) {
|
||||
this.modify();
|
||||
this.mOrganizer = v;
|
||||
},
|
||||
|
||||
/* MEMBER_ATTR(mIcalString, "", icalString), */
|
||||
get icalString() {
|
||||
throw Components.results.NS_NOT_IMPLEMENTED;
|
||||
|
@ -267,6 +279,7 @@ calItemBase.prototype = {
|
|||
"EXDATE": true,
|
||||
"RDATE": true,
|
||||
"ATTENDEE": true,
|
||||
"ORGANIZER": true,
|
||||
},
|
||||
|
||||
mapPropsFromICS: function(icalcomp, propmap) {
|
||||
|
@ -303,7 +316,6 @@ calItemBase.prototype = {
|
|||
this.modify();
|
||||
|
||||
this.mapPropsFromICS(icalcomp, this.icsBasePropMap);
|
||||
this.mPrivacy = icalcomp.icalClass;
|
||||
|
||||
for (var attprop = icalcomp.getFirstProperty("ATTENDEE");
|
||||
attprop;
|
||||
|
@ -313,6 +325,13 @@ calItemBase.prototype = {
|
|||
att.icalProperty = attprop;
|
||||
this.addAttendee(att);
|
||||
}
|
||||
|
||||
var orgprop = icalcomp.getFirstProperty("ORGANIZER");
|
||||
if (orgprop) {
|
||||
var org = new CalAttendee();
|
||||
org.icalProperty = orgprop;
|
||||
this.mOrganizer = org;
|
||||
}
|
||||
|
||||
var gen = icalcomp.getFirstProperty("X-MOZILLA-GENERATION");
|
||||
if (gen)
|
||||
|
@ -370,8 +389,9 @@ calItemBase.prototype = {
|
|||
var suppressDCE = this.lastModifiedTime;
|
||||
suppressDCE = this.stampTime;
|
||||
this.mapPropsToICS(icalcomp, this.icsBasePropMap);
|
||||
icalcomp.icalClass = this.mPrivacy;
|
||||
|
||||
if (this.mOrganizer)
|
||||
icalcomp.addProperty(this.mOrganizer.icalProperty);
|
||||
for (var i = 0; i < this.mAttendees.length; i++)
|
||||
icalcomp.addProperty(this.mAttendees[i].icalProperty);
|
||||
|
||||
|
|
|
@ -47,7 +47,13 @@ MODULE = lightning
|
|||
export XPI_NAME = lightning
|
||||
XPI_INSTALL_EXTRAS = $(srcdir)/chrome.manifest
|
||||
XPI_PKGNAME = lightning
|
||||
DIRS = ../../db/sqlite3/src ../../storage ../libical ../base ../providers
|
||||
|
||||
DIRS = ../../db/sqlite3/src ../../storage \
|
||||
../../extensions/xmlextras \
|
||||
../../extensions/webdav \
|
||||
../libical ../base ../providers \
|
||||
components \
|
||||
$(NULL)
|
||||
|
||||
# Select a theme from which to pull our skin goodness
|
||||
# OS X: pinstripe
|
||||
|
|
Загрузка…
Ссылка в новой задаче