Show plain calendar name for shared calendars, drop ~owner prefix

DAVx5/CalDAV clients displayed a shared calendar's DAV:displayname as
"alice~work" (the synthetic owner~name local identifier nidus uses
internally to keep a shared calendar's URL unique per subscriber).
That internal name is still needed for routing (it's still what appears
in the calendar's URL path), but there's no reason to show it to the
end user as the calendar's label.

calendarMeta() now always sets caldav.Calendar.Name to the plain
calendar name (e.g. "work"), while Path still uses the "owner~name"
local name. The web UI already showed the plain name via a separate
"shared by <owner>" entry, so it's unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-08-20 10:09:41 +02:00
co-authored by Copilot
parent 5f72e58ad3
commit 65cd24a192
2 changed files with 9 additions and 5 deletions
+3 -3
View File
@@ -90,14 +90,14 @@ func TestListCalendarsIncludesSharedCalendar(t *testing.T) {
}
var found bool
wantName := sharedCalendarName("alice", "work")
wantPath := calHomePath() + sharedCalendarName("alice", "work") + "/"
for _, c := range cals {
if c.Name == wantName {
if c.Path == wantPath && c.Name == "work" {
found = true
}
}
if !found {
t.Errorf("shared calendar %q not found in ListCalendars result: %+v", wantName, cals)
t.Errorf("shared calendar with path %q and display name %q not found in ListCalendars result: %+v", wantPath, "work", cals)
}
}