From ef4a14a831c7e8670de571ef8cf3a09ea2345019 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 7 Jul 2024 23:37:43 -0300 Subject: [PATCH] nip11: signal support for deletions and count if those handlers exist. --- handlers.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/handlers.go b/handlers.go index cf0b00d..0c94ad6 100644 --- a/handlers.go +++ b/handlers.go @@ -282,6 +282,14 @@ func (rl *Relay) HandleNIP11(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/nostr+json") info := *rl.Info + + if len(rl.DeleteEvent) > 0 { + info.SupportedNIPs = append(info.SupportedNIPs, 9) + } + if len(rl.CountEvents) > 0 { + info.SupportedNIPs = append(info.SupportedNIPs, 45) + } + for _, ovw := range rl.OverwriteRelayInformation { info = ovw(r.Context(), r, info) }