Use display name instead of username for shared calendar owners
Add db.DisplayName(username), returning the user's display name if
set, otherwise the raw username. Use it everywhere a shared calendar's
owner is shown: the web calendar legend ("shared by ..."), the "new
event"/edit calendar select label, the dashboard's "Shared with you"
list, and the CalDAV-side description/name-collision disambiguation
("Name (Owner)") shown to CalDAV clients like DAVx5.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -26,7 +26,7 @@ func (s *Server) handleDashboard(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
for _, sh := range calShares {
|
||||
sharedWithMe = append(sharedWithMe, templates.SharedWithMeItem{
|
||||
Kind: "calendar", Owner: sh.Owner, Name: sh.CalendarName, Permission: string(sh.Permission),
|
||||
Kind: "calendar", Owner: s.dbase.DisplayName(sh.Owner), Name: sh.CalendarName, Permission: string(sh.Permission),
|
||||
})
|
||||
}
|
||||
bookShares, err := s.dbase.AddressBooksSharedWith(username)
|
||||
@@ -35,7 +35,7 @@ func (s *Server) handleDashboard(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
for _, sh := range bookShares {
|
||||
sharedWithMe = append(sharedWithMe, templates.SharedWithMeItem{
|
||||
Kind: "addressbook", Owner: sh.Owner, Name: sh.AddressBookName, Permission: string(sh.Permission),
|
||||
Kind: "addressbook", Owner: s.dbase.DisplayName(sh.Owner), Name: sh.AddressBookName, Permission: string(sh.Permission),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user