mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-10-30 01:26:32 +00:00
handle kind 4-45 and kind2
This commit is contained in:
parent
990e47eb2b
commit
231fdc6aa9
@ -57,8 +57,14 @@ func HandleKind(ctx context.Context, evt relay.Event, ws *websocket.Conn) {
|
||||
err = kinds.HandleKind0(ctx, evt, collection, ws)
|
||||
case evt.Kind == 1:
|
||||
err = kinds.HandleKind1(ctx, evt, collection)
|
||||
case evt.Kind == 2:
|
||||
err = kinds.HandleKind2Deprecated(ctx, evt, ws)
|
||||
case evt.Kind == 3:
|
||||
err = kinds.HandleReplaceableKind(ctx, evt, collection, ws)
|
||||
case evt.Kind >= 4 && evt.Kind < 45:
|
||||
err = kinds.HandleRegularKind(ctx, evt, collection)
|
||||
case evt.Kind >= 1000 && evt.Kind < 10000:
|
||||
err = kinds.HandleRegularKind(ctx, evt, collection)
|
||||
case evt.Kind >= 10000 && evt.Kind < 20000:
|
||||
err = kinds.HandleReplaceableKind(ctx, evt, collection, ws)
|
||||
case evt.Kind >= 20000 && evt.Kind < 30000:
|
||||
|
12
relay/kinds/kind2.go
Normal file
12
relay/kinds/kind2.go
Normal file
@ -0,0 +1,12 @@
|
||||
package kinds
|
||||
|
||||
import (
|
||||
"context"
|
||||
relay "grain/relay/types"
|
||||
|
||||
"golang.org/x/net/websocket"
|
||||
)
|
||||
func HandleKind2Deprecated(ctx context.Context, evt relay.Event, ws *websocket.Conn) error {
|
||||
sendNotice(ws, evt.PubKey, "kind 2 is deprecated, event not accepted to the relay, please use kind 10002 as defined in NIP-65")
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user