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

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