Closed Bug 451020 Opened 18 years ago Closed 18 years ago

Support for mixed server/non-server attendees

Categories

(Calendar :: Provider: CalDAV, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dbo, Assigned: dbo)

References

Details

Attachments

(2 files)

follow up on bug 409921: In case the CUA specified a mix of server-users and non-server users as attendees, we want to use caldav (outbox) scheduling for all server attendees and fall back to iMIP for all non-server attendees.
I have a draft patch for this, so I'll take it.
Assignee: nobody → browning
Blocks: 451039
Flags: blocking-calendar0.9+
this adds the fall-back-to-email bit, fixes some freebusy bustage, and removes some unneeded code
Attachment #334404 - Flags: review?(daniel.boelzle)
Comment on attachment 334404 [details] [diff] [review] fall back to email >+ var failedDeliveries = []; >+ for (var i = 0; i < responseXML.*.length(); i++) { >+ var response = new XML(responseXML.*[i]); >+ >+ var recip = response..C::recipient..D::href; >+ var status = response..C::["request-status"]; >+ if (status.substr(0,1) != "2") { >+ failedDeliveries.push(recip); >+ if (thisCalendar.verboseLogging()) { >+ LOG("CalDAV: failed delivery to " + recip); >+ } >+ } >+ } >+ >+ var remainingAttendees = []; >+ var j = 0; >+ while (failedDeliveries[j]) { >+ var k = 0; >+ while (aRecipients[k]) { >+ if (failedDeliveries[j].toLowerCase() == >+ aRecipients[k].id.toLowerCase()) { >+ remainingAttendees.push(aRecipients[k]); >+ break; >+ } >+ k++; >+ } >+ j++; >+ } >+ I think we could resolve the second loop easily, integrating it into the above one. >+ if (remainingAttendees.length) { >+ if (thisCalendar.verboseLogging()) { >+ LOG("CalDAV: sending email to " + >+ remainingAttendees.length + " recipients"); >+ } >+ var imipTransport = Components.classes["@mozilla.org/calendar/itip-transport;1?type=email"] >+ .getService(Components.interfaces.calIItipTransport); A check against a configured email identity is missing, and I think we should consolidate that code into calProviderUtils.js. >+ var subjectStringId = ""; >+ var bodyStringId = ""; >+ switch (aItipItem.responseMethod) { >+ case 'REQUEST': >+ subjectStringId = "itipRequestSubject"; >+ bodyStringId = "itipRequestBody"; >+ break; >+ case 'CANCEL': >+ subjectStringId = "itipCancelSubject"; >+ bodyStringId = "itipCancelBody"; >+ break; >+ } >+ var summary = (item.getProperty("SUMMARY") || ""); >+ var subject = calGetString("lightning", >+ subjectStringId, >+ [summary], >+ "lightning"); >+ var body = calGetString("lightning", >+ bodyStringId, >+ [item.organizer ? item.organizer.toString() : "", summary], >+ "lightning"); To not copy this code where needed, IMO we should put it into calItipTransport, removing body and subject parameter, which are transport-specific. Moreover, I think we could resolve simpleSendResponse into sendItems as well, since it's little more code. >+ imipTransport.sendItems(remainingAttendees.length, >+ remainingAttendees, >+ subject, >+ body, >+ aItipItem); >+ } >+ } > } r- for now
Attachment #334404 - Flags: review?(daniel.boelzle) → review-
Assignee: browning → daniel.boelzle
Status: NEW → ASSIGNED
Attachment #334469 - Flags: review?(philipp)
Comment on attachment 334469 [details] [diff] [review] fall back to email - v2, + changing iTIP transport > // XXX discuss: does it make sense to check targetCalendar.canNotify(respMethod, ...) here? > // _isExistingItem will store the item btw, I do think it makes sense to call that here. >+ LOG(STACK(20)); Remove r=philipp
Attachment #334469 - Flags: review?(philipp) → review+
Checked in on HEAD and MOZILLA_1_8_BRANCH => FIXED.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.9
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: