Also include the changeKey

This commit is contained in:
Andreas Schneider 2018-03-31 15:25:00 +02:00
parent 1e9293ac86
commit 84b660a7ef
1 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,8 @@ import (
)
type FolderId struct {
Id string `xml:",attr"`
Id string `xml:",attr"`
ChangeKey string `xml:",attr"`
}
type CalendarItem struct {
@ -53,7 +54,7 @@ func (e *EWSCalendar) prepareRequest(body io.Reader) (req *http.Request, err err
return
}
func (e *EWSCalendar) getCalendarFolderID() (id string, err error) {
func (e *EWSCalendar) getCalendarFolderID() (id *FolderId, err error) {
req, err := e.prepareRequest(strings.NewReader(folderIdRequest))
if err != nil {
return
@ -87,9 +88,8 @@ func (e *EWSCalendar) getCalendarFolderID() (id string, err error) {
switch t := t.(type) {
case xml.StartElement:
if t.Name.Local == "FolderId" {
fid := FolderId{}
err = d.DecodeElement(&fid, &t)
id = fid.Id
id = &FolderId{}
err = d.DecodeElement(id, &t)
// The first one is enough
return
}