WIP: ATTENDEE prop support #46

Draft
sinavir wants to merge 4 commits from mdebray/attendees into master
Showing only changes of commit 5451f0d4cc - Show all commits

View file

@ -227,11 +227,11 @@ class Calendar {
_parse_vevent(vevent) { _parse_vevent(vevent) {
const event = {} const event = {}
vevent.forEach(elt => { vevent.forEach(elt => {
if (elt[0] == "attendee" && elt[1].cn && elt[1].role == "CHAIR") { if (elt[0] === "attendee") {
if (event[elt[0]] === undefined) event["speakers"] = [] if (event[elt[0]] === undefined) event[elt[0]] = []
event["speakers"].push({ event[elt[0]].push({
cn: elt[1].cn, props: elt[1],
calAddress: elt[3] val: elt[3]
}); });
} else { } else {
event[elt[0]] = elt[3] event[elt[0]] = elt[3]
@ -288,8 +288,8 @@ function fcEventFromjCalEvent(cal) {
fcEvent.classNames = [`st-${evt.status.toLowerCase()}`] fcEvent.classNames = [`st-${evt.status.toLowerCase()}`]
} }
if (evt.speakers) { if (evt.attendee) {
fcEvent.speakers = evt.speakers fcEvent.speakers = evt.attendee.filter(a => a.prop.cn && a.prop.role === "REQ-PARTICIPANT")
} }
if (evt.rrule) { if (evt.rrule) {