caldav: add expand request to client

This commit is contained in:
Jonathan Liu
2024-08-18 15:07:19 -07:00
committed by Simon Ser
parent b689d5daff
commit 75c185517e
3 changed files with 28 additions and 2 deletions

View File

@@ -154,7 +154,9 @@ func encodeCalendarReq(c *CalendarCompRequest) (*internal.Prop, error) {
return nil, err
}
calDataReq := calendarDataReq{Comp: compReq}
expandReq := encodeExpandRequest(c.Expand)
calDataReq := calendarDataReq{Comp: compReq, Expand: expandReq}
getLastModReq := internal.NewRawXMLElement(internal.GetLastModifiedName, nil, nil)
getETagReq := internal.NewRawXMLElement(internal.GetETagName, nil, nil)
@@ -213,6 +215,17 @@ func encodeTextMatch(tm *TextMatch) *textMatch {
return encoded
}
func encodeExpandRequest(e *CalendarExpandRequest) *expand {
if e == nil {
return nil
}
encoded := expand{
Start: dateWithUTCTime(e.Start),
End: dateWithUTCTime(e.End),
}
return &encoded
}
func decodeCalendarObjectList(ms *internal.MultiStatus) ([]CalendarObject, error) {
addrs := make([]CalendarObject, 0, len(ms.Responses))
for _, resp := range ms.Responses {