Skip to content

Commit

Permalink
fix relay supported nips to actually sort
Browse files Browse the repository at this point in the history
  • Loading branch information
mleku committed Dec 13, 2024
1 parent 76c193a commit c72dc14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions realy/relayinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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())
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion realy/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.3.8
v1.3.9

0 comments on commit c72dc14

Please sign in to comment.