Skip to content

Commit

Permalink
Added RSVP property
Browse files Browse the repository at this point in the history
  • Loading branch information
tbartelmess committed May 14, 2020
1 parent 47563a7 commit c0020cc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Sources/SwiftIcal/Component.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public struct Attendee {
type: CalendarUserType = .individual,
participationStatus: EventParticipationStatus = .needsAction,
role: Role = .requiredParticipant,
rsvp: Bool = false,
member: CalendarUserAddress? = nil,
delegatedTo: [CalendarUserAddress]? = nil,
delegatedFrom: [CalendarUserAddress]? = nil,
Expand All @@ -188,6 +189,7 @@ public struct Attendee {
self.type = type
self.participationStatus = participationStatus
self.role = role
self.rsvp = rsvp
self.member = member
self.delegatedTo = delegatedTo
self.delegatedFrom = delegatedFrom
Expand Down Expand Up @@ -230,6 +232,9 @@ public struct Attendee {
/// Common name for the attendee calendar user,
/// e.g. John Smith.
public var commonName: CommonName?

/// Property if the attendee is requested to send
public var rsvp: Bool
}

extension Attendee: LibicalPropertyConvertible {
Expand Down Expand Up @@ -264,6 +269,10 @@ extension Attendee: LibicalPropertyConvertible {
if let commonName = commonName {
icalproperty_add_parameter(property, icalparameter_new_cn(commonName))
}

if rsvp == true {
icalproperty_add_parameter(property, icalparameter_new_rsvp(ICAL_RSVP_TRUE))
}
return property!
}
}
Expand Down

0 comments on commit c0020cc

Please sign in to comment.