forked from aksdb/CalAnonSync
Added hashing of EWS calendar item IDs
This commit is contained in:
parent
5d62c932d5
commit
e3288f9848
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue