hivedav

A curlable free/busy scheduler with CalDAV integration
git clone https://git.in0rdr.ch/hivedav.git
Log | Files | Refs | Pull requests | README | LICENSE

commit 3af4837e85ad297b545df237c68ff54734b859f9
parent a46e67ec297cd981ec27577b25041a96a20b7fd0
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Thu, 21 Dec 2023 17:02:58 +0100

feat: check X-MICROSOFT-CDO-INTENDEDSTATUS

Diffstat:
Mserver.go | 16++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/server.go b/server.go @@ -197,12 +197,14 @@ func (s *Server) Week(w http.ResponseWriter, req *http.Request, ps httprouter.Pa // overwrite with requested year and week year, err := strconv.Atoi(ps.ByName("year")) - if err != nil { log.Printf("Cannot serve requested year '%d'\n", year) + if err != nil { + log.Printf("Cannot serve requested year '%d'\n", year) http.Error(w, fmt.Sprintf("Cannot serve requested year '%d'\n", year), http.StatusBadRequest) return } week, err := strconv.Atoi(ps.ByName("week")) - if err != nil { log.Printf("Cannot serve requested week '%d'\n", week) + if err != nil { + log.Printf("Cannot serve requested week '%d'\n", week) http.Error(w, fmt.Sprintf("Cannot serve requested week '%d'\n", week), http.StatusBadRequest) return } @@ -405,6 +407,16 @@ func (s *Server) UpdateAvailability(calData []caldav.CalData) error { start := e.Props.Get(ical.PropDateTimeStart).Value end := e.Props.Get(ical.PropDateTimeEnd).Value + status := e.Props.Get("X-MICROSOFT-CDO-INTENDEDSTATUS") + statusValue := "BUSY" + if status != nil { + statusValue = status.Value + } + if statusValue == "FREE" { + // do not store "blocker" events + continue + } + // Parse all possible time formats // Don't use ical DateTime(), has problems with some timezones startTime, err := parseTime(start, tzOffsetDuration)