From c72dc142c7184d0e692b6877ca99ba520cf9337f Mon Sep 17 00:00:00 2001 From: mleku Date: Fri, 13 Dec 2024 19:41:05 +0000 Subject: [PATCH] fix relay supported nips to actually sort --- realy/relayinfo.go | 19 +++++++++++++------ realy/version | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/realy/relayinfo.go b/realy/relayinfo.go index f17c4a0..7426b2a 100644 --- a/realy/relayinfo.go +++ b/realy/relayinfo.go @@ -8,6 +8,7 @@ import ( "realy.lol/relay" "realy.lol/relayinfo" "realy.lol/store" + "realy.lol/number" ) func (s *Server) handleRelayInfo(w http.ResponseWriter, r *http.Request) { @@ -17,12 +18,7 @@ func (s *Server) handleRelayInfo(w http.ResponseWriter, r *http.Request) { if informationer, ok := s.relay.(relay.Informationer); ok { info = informationer.GetNIP11InformationDocument() } else { - supportedNIPs := relayinfo.GetList(relayinfo.BasicProtocol, relayinfo.EventDeletion, - relayinfo.RelayInformationDocument, relayinfo.GenericTagQueries, - relayinfo.NostrMarketplace, - relayinfo.EventTreatment, relayinfo.CommandResults, - relayinfo.ParameterizedReplaceableEvents, - relayinfo.ProtectedEvents) + var supportedNIPs number.List var auther relay.Authenticator if auther, ok = s.relay.(relay.Authenticator); ok && auther.ServiceUrl(r) != "" { supportedNIPs = append(supportedNIPs, relayinfo.Authentication.N()) @@ -33,6 +29,17 @@ func (s *Server) handleRelayInfo(w http.ResponseWriter, r *http.Request) { supportedNIPs = append(supportedNIPs, relayinfo.CountingResults.N()) } } + supportedNIPs = relayinfo.GetList( + relayinfo.BasicProtocol, + relayinfo.EventDeletion, + relayinfo.RelayInformationDocument, + relayinfo.GenericTagQueries, + relayinfo.NostrMarketplace, + relayinfo.EventTreatment, + relayinfo.CommandResults, + relayinfo.ParameterizedReplaceableEvents, + relayinfo.ProtectedEvents, + ) log.T.Ln("supported NIPs", supportedNIPs) info = &relayinfo.T{Name: s.relay.Name(), Description: "relay powered by the realy framework", diff --git a/realy/version b/realy/version index 4c8a05a..8185624 100644 --- a/realy/version +++ b/realy/version @@ -1 +1 @@ -v1.3.8 \ No newline at end of file +v1.3.9 \ No newline at end of file