@@ -120,7 +120,8 @@ const RELAY_FIELDS = {
120120const RELAY_FILTERS = {
121121 all : { } ,
122122 online : { online : true } ,
123- writable : { acceptsEvents : true } ,
123+ // "public" = reachable, accepts events, and open to anyone (no pay/auth).
124+ public : { online : true , acceptsEvents : true , requiresPayment : { $ne : true } , requiresAuth : { $ne : true } } ,
124125 paid : { requiresPayment : true } ,
125126 auth : { requiresAuth : true } ,
126127} ;
@@ -143,7 +144,7 @@ export async function relaysDirectory({ filter = 'online', sort = 'recent', limi
143144 $facet : {
144145 all : count ( RELAY_FILTERS . all ) ,
145146 online : count ( RELAY_FILTERS . online ) ,
146- writable : count ( RELAY_FILTERS . writable ) ,
147+ public : count ( RELAY_FILTERS . public ) ,
147148 paid : count ( RELAY_FILTERS . paid ) ,
148149 auth : count ( RELAY_FILTERS . auth ) ,
149150 newest : [ { $sort : { lastChecked : - 1 } } , { $limit : 1 } , { $project : { _id : 0 , lastChecked : 1 } } ] ,
@@ -152,7 +153,7 @@ export async function relaysDirectory({ filter = 'online', sort = 'recent', limi
152153 } ] ) . toArray ( ) ;
153154 const n = ( k ) => res ?. [ k ] ?. [ 0 ] ?. n || 0 ;
154155 return {
155- counts : { all : n ( 'all' ) , online : n ( 'online' ) , writable : n ( 'writable ' ) , paid : n ( 'paid' ) , auth : n ( 'auth' ) } ,
156+ counts : { all : n ( 'all' ) , online : n ( 'online' ) , public : n ( 'public ' ) , paid : n ( 'paid' ) , auth : n ( 'auth' ) } ,
156157 lastChecked : res ?. newest ?. [ 0 ] ?. lastChecked || null ,
157158 relays : res ?. page || [ ] ,
158159 } ;
0 commit comments