define a nostr.Kind type for event kinds, make adjustments everywhere and fix some horrible bugs with mmm, lmdb and badger querying and deleting.

This commit is contained in:
fiatjaf
2025-04-20 11:14:39 -03:00
parent 27f40c2cf2
commit 15c6093c9b
74 changed files with 689 additions and 404 deletions

View File

@@ -12,7 +12,7 @@ import (
func GetDMRelays(ctx context.Context, pubkey nostr.PubKey, pool *nostr.Pool, relaysToQuery []string) []string {
ie := pool.QuerySingle(ctx, relaysToQuery, nostr.Filter{
Authors: []nostr.PubKey{pubkey},
Kinds: []uint16{nostr.KindDMRelayList},
Kinds: []nostr.Kind{nostr.KindDMRelayList},
}, nostr.SubscriptionOptions{Label: "dm-relays"})
if ie == nil {
return nil
@@ -154,7 +154,7 @@ func ListenForMessages(
}
for ie := range pool.SubscribeMany(ctx, ourRelays, nostr.Filter{
Kinds: []uint16{nostr.KindGiftWrap},
Kinds: []nostr.Kind{nostr.KindGiftWrap},
Tags: nostr.TagMap{"p": []string{pk.Hex()}},
Since: &since,
}, nostr.SubscriptionOptions{Label: "mydms"}) {