6 Commits

Author SHA1 Message Date
fiatjaf
86853004ef change parsing so NIP12 can work, rename types. 2022-02-08 16:27:33 -03:00
fiatjaf
ef1f548212 avoid sending to closed Events/UniqueEvents channels. 2022-02-07 11:33:45 -03:00
Honza Pokorny
a3df2cb893 Add mutexes around websockets
We replace the bare websocket.Conn type with a new Connection type which
implements `WriteJSON`, `WriteMessage`, and `Close`.  The Connection
type adds mutexes around writes since gorilla doesn't support concurrent
writes to websockets.

Signed-off-by: Honza Pokorny <honza@pokorny.ca>
2022-01-12 12:19:33 -03:00
Honza Pokorny
26c3b4aac9 Remove unnecessary argument to subscription.Sub
The `Sub()` function retrieves the list of filters from the
`Subscripton` object itself, and therefore it's unnecessary to pass it
in.  The argument is unused.

Here, we remove the function argument from the definition, and from the
single call site.  We then pass the filters to the initializer.

This makes it so that filters are in fact passed to the relay on the wire.
2022-01-04 12:24:05 -03:00
fiatjaf
140edc693c relay policies as interfaces, SimplePolicy as the most basic implementation. 2022-01-02 08:50:53 -03:00
fiatjaf
d131e8460e move everything to the same directory. 2022-01-02 08:44:18 -03:00