sdk/hints: use a single "hint" type instead of nprofile/nevent/tag/nip05.

This commit is contained in:
fiatjaf
2025-01-18 18:19:54 -03:00
parent 6cffcc3b47
commit 40538486d5
6 changed files with 24 additions and 50 deletions

View File

@@ -3,7 +3,6 @@ package sdk
import (
"context"
"fmt"
"strings"
"sync"
"time"
@@ -83,13 +82,9 @@ func (sys System) FetchProfileFromInput(ctx context.Context, nip19OrNip05Code st
return ProfileMetadata{}, fmt.Errorf("couldn't decode profile reference")
}
hintType := hints.LastInNIP05
if strings.HasPrefix(nip19OrNip05Code, "nprofile") {
hintType = hints.LastInNprofile
}
for _, r := range p.Relays {
if !IsVirtualRelay(r) {
sys.Hints.Save(p.PublicKey, nostr.NormalizeURL(r), hintType, nostr.Now())
sys.Hints.Save(p.PublicKey, nostr.NormalizeURL(r), hints.LastInHint, nostr.Now())
}
}