From c0020cc6d097003385666cb29c4020ce6e9f2708 Mon Sep 17 00:00:00 2001 From: Thomas Bartelmess Date: Wed, 13 May 2020 22:06:40 -0400 Subject: [PATCH] Added RSVP property --- Sources/SwiftIcal/Component.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/SwiftIcal/Component.swift b/Sources/SwiftIcal/Component.swift index 518c619..ffaf6d7 100644 --- a/Sources/SwiftIcal/Component.swift +++ b/Sources/SwiftIcal/Component.swift @@ -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, @@ -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 @@ -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 { @@ -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! } }