Never leak a shared calendar's real name to recipients

_cal_dict now labels shared (non-owned) calendars by the sharer/group name
(the value already computed for shared_by) instead of the owner's real calendar
name. Fixes recipients seeing the true name in calendar-management lists (and
anywhere else the name is shown); all clients pick it up automatically.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-16 11:15:35 +02:00
parent a7802778b6
commit 12c869451b

View File

@@ -82,7 +82,9 @@ def _cal_dict(cal: models.LocalCalendar, *, owned: bool = True,
request: Optional[Request] = None) -> dict:
d = {
"id": cal.id,
"name": cal.name,
# A shared calendar is labelled by the person/group it comes from — the
# owner's real calendar name must never reach recipients.
"name": shared_by if (not owned and shared_by is not None) else cal.name,
# A recipient's own colour for a shared calendar wins over the owner's.
"color": color_override or cal.color,
"enabled": cal.enabled,