progress
This commit is contained in:
@@ -407,10 +407,8 @@ func (b *DBBackend) filterCalendar(ctx context.Context, ownerName string, origin
|
||||
}
|
||||
|
||||
class := b.defaultClass;
|
||||
log.Printf("class: %s",class)
|
||||
if prop := child.Props.Get("CLASS"); prop != nil {
|
||||
class = strings.ToUpper(prop.Value)
|
||||
log.Printf("class: %s",class)
|
||||
}
|
||||
|
||||
switch class {
|
||||
@@ -432,7 +430,6 @@ func (b *DBBackend) filterCalendar(ctx context.Context, ownerName string, origin
|
||||
redacted.Props.SetText("SUMMARY", b.redactionText)
|
||||
filtered.Children = append(filtered.Children, redacted)
|
||||
case "PUBLIC":
|
||||
log.Printf("pub: %s", child.Name);
|
||||
filtered.Children = append(filtered.Children, child)
|
||||
}
|
||||
}
|
||||
@@ -527,7 +524,7 @@ func (b *DBBackend) GetCalendar(ctx context.Context, p string) (*caldav.Calendar
|
||||
return &cal, nil
|
||||
}
|
||||
|
||||
// CreateCalendar is disabled because we manage calendars via config.yaml.
|
||||
// CreateCalendar is disabled because calendars are managed via the config
|
||||
func (b *DBBackend) CreateCalendar(ctx context.Context, calendar *caldav.Calendar) error {
|
||||
return webdav.NewHTTPError(http.StatusForbidden, errors.New("calendar creation only via config"))
|
||||
}
|
||||
@@ -713,12 +710,12 @@ func (b *DBBackend) GetCalendarObject(ctx context.Context, p string, req *caldav
|
||||
// Re-apply labels for the virtual view
|
||||
for _, child := range filteredData.Children {
|
||||
if child.Name == "VEVENT" || child.Name == "VTODO" {
|
||||
summary := child.Props.Get("SUMMARY")
|
||||
descr := child.Props.Get("DESCRIPTION")
|
||||
val := ""
|
||||
if summary != nil {
|
||||
val = summary.Value
|
||||
if descr != nil {
|
||||
val = descr.Value
|
||||
}
|
||||
child.Props.SetText("SUMMARY", fmt.Sprintf("[%s] %s", sourceID, val))
|
||||
child.Props.SetText("DESCRIPTION", fmt.Sprintf("[%s]\n%s", sourceID, val))
|
||||
}
|
||||
}
|
||||
obj.Data = filteredData
|
||||
|
||||
Reference in New Issue
Block a user