Added hashing of EWS calendar item IDs

This commit is contained in:
Andreas Schneider 2018-04-01 16:19:20 +02:00
parent 5d62c932d5
commit e3288f9848
1 changed files with 16 additions and 4 deletions

View File

@ -2,6 +2,8 @@ package main
import ( import (
"bytes" "bytes"
"crypto/md5"
"encoding/hex"
"encoding/xml" "encoding/xml"
"fmt" "fmt"
"io" "io"
@ -18,10 +20,20 @@ type FolderId struct {
} }
type CalendarItem struct { type CalendarItem struct {
Subject string Subject string
UID string UID string
Start time.Time Start time.Time
End time.Time End time.Time
RecurrenceId string
Sensitivity string
CalendarItemType string
}
func (ci CalendarItem) Hash() string {
h := md5.New()
h.Write([]byte(ci.UID))
h.Write([]byte(ci.RecurrenceId))
return strings.ToUpper(hex.EncodeToString(h.Sum(nil)))
} }
type EWSCalendar struct { type EWSCalendar struct {