feat: support more messaging kinds

This commit is contained in:
Amarpreet Minhas 2024-08-17 15:42:14 -04:00
parent 54e3271c37
commit 69a9111aa0

View file

@ -14,8 +14,8 @@ func RejectUnregisteredNpubs(ctx context.Context, event *nostr.Event) (reject bo
var err error
l := gologger.Get(config.GetConfig().LogLevel).With().Str("context", "nostr-reject-unregistered").Logger()
// always allow auth messages
if event.Kind == 22242 {
// always allow auth messages and seals
if event.Kind == 22242 || event.Kind == 13 {
return false, ""
}
@ -27,8 +27,8 @@ func RejectUnregisteredNpubs(ctx context.Context, event *nostr.Event) (reject bo
}
npubs := []string{authenticatedUser}
// add recipients to npubs list
if event.Kind == 4 || event.Kind == 14 {
// add recipients of dms (nip04)/private dms (nip17)/gift wraps (nip59) to npubs list
if event.Kind == 4 || event.Kind == 14 || event.Kind == 1059 {
for _, npub := range event.Tags.GetAll([]string{"p"}) {
npubs = append(npubs, npub.Value())
}