diff --git a/features/connections/handlers.go b/features/connections/handlers.go index e45acb5..ab9ab18 100644 --- a/features/connections/handlers.go +++ b/features/connections/handlers.go @@ -436,6 +436,19 @@ func (h *Handlers) View(w http.ResponseWriter, r *http.Request) { } } + // Current-event association: only for ATProto viewers checked into an + // ongoing event who have a PDS connection record with this target. + if evURI, ok, cErr := checkin.Current(r.Context(), h.DB, viewerDID); cErr == nil && ok && evURI != "" { + if rec, found := connection.FindForTarget(entries, target); found { + view.CurrentEventURI = evURI + view.ConnRecordURI = rec.URI + view.AssociatedWithCurrent = rec.EventURI == evURI + if ev, gErr := event.Get(r.Context(), h.DB, evURI); gErr == nil { + view.CurrentEventName = ev.Name + } + } + } + // Load private notes from SQLite. note, err := notes.Get(r.Context(), h.DB, viewerDID.String(), target.String()) if err != nil {