diff --git a/src/calanonsync/calanonsync.go b/src/calanonsync/calanonsync.go index 57a66d5..be6f93a 100644 --- a/src/calanonsync/calanonsync.go +++ b/src/calanonsync/calanonsync.go @@ -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 }