Issue #501: Event support (#704)

Added EventRecurs as option for backup details.
This commit is contained in:
Danny 2022-08-31 12:04:13 -04:00 committed by GitHub
parent 245bb6e73e
commit 068f0560e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View File

@ -11,9 +11,11 @@ import (
// EventInfo searchable metadata for stored event objects. // EventInfo searchable metadata for stored event objects.
func EventInfo(evt models.Eventable) *details.ExchangeInfo { func EventInfo(evt models.Eventable) *details.ExchangeInfo {
organizer := "" var (
subject := "" organizer, subject string
start := time.Time{} recurs bool
start = time.Time{}
)
if evt.GetOrganizer() != nil && if evt.GetOrganizer() != nil &&
evt.GetOrganizer().GetEmailAddress() != nil && evt.GetOrganizer().GetEmailAddress() != nil &&
@ -27,6 +29,10 @@ func EventInfo(evt models.Eventable) *details.ExchangeInfo {
subject = *evt.GetSubject() subject = *evt.GetSubject()
} }
if evt.GetRecurrence() != nil {
recurs = true
}
if evt.GetStart() != nil && if evt.GetStart() != nil &&
evt.GetStart().GetDateTime() != nil { evt.GetStart().GetDateTime() != nil {
// timeString has 'Z' literal added to ensure the stored // timeString has 'Z' literal added to ensure the stored
@ -43,5 +49,6 @@ func EventInfo(evt models.Eventable) *details.ExchangeInfo {
Organizer: organizer, Organizer: organizer,
Subject: subject, Subject: subject,
EventStart: start, EventStart: start,
EventRecurs: recurs,
} }
} }

View File

@ -142,6 +142,7 @@ type ExchangeInfo struct {
EventStart time.Time `json:"eventStart,omitempty"` EventStart time.Time `json:"eventStart,omitempty"`
Organizer string `json:"organizer,omitempty"` Organizer string `json:"organizer,omitempty"`
ContactName string `json:"contactName,omitempty"` ContactName string `json:"contactName,omitempty"`
EventRecurs bool `json:"eventRecurs,omitempty"`
} }
// Headers returns the human-readable names of properties in an ExchangeInfo // Headers returns the human-readable names of properties in an ExchangeInfo