feat(kind): using constants

This commit is contained in:
Isaque Veras
2023-09-06 21:00:05 -03:00
committed by fiatjaf_
parent eef7c40dc7
commit 0f66883dc7
12 changed files with 38 additions and 35 deletions

View File

@@ -27,7 +27,10 @@ func FetchRelaysForPubkey(ctx context.Context, pool *nostr.SimplePool, pubkey st
ch := pool.SubManyEose(ctx, relays, nostr.Filters{
{
Kinds: []int{10002, 3},
Kinds: []int{
nostr.KindRelayListMetadata,
nostr.KindContactList,
},
Authors: []string{pubkey},
Limit: 2,
},
@@ -37,9 +40,9 @@ func FetchRelaysForPubkey(ctx context.Context, pool *nostr.SimplePool, pubkey st
i := 0
for event := range ch {
switch event.Kind {
case 10002:
case nostr.KindRelayListMetadata:
result = append(result, ParseRelaysFromKind10002(event)...)
case 3:
case nostr.KindContactList:
result = append(result, ParseRelaysFromKind3(event)...)
}