sdk: fix InputToProfile() to support nip05 again.

This commit is contained in:
fiatjaf
2025-11-26 09:04:47 -03:00
parent 44130595c6
commit 7261a4b515
+2 -4
View File
@@ -17,10 +17,7 @@ func InputToProfile(ctx context.Context, input string) *nostr.ProfilePointer {
// handle nip19 codes, if that's the case // handle nip19 codes, if that's the case
prefix, data, err := nip19.Decode(input) prefix, data, err := nip19.Decode(input)
if err != nil { if err == nil {
return nil
}
switch prefix { switch prefix {
case "npub": case "npub":
return &nostr.ProfilePointer{PublicKey: data.(nostr.PubKey)} return &nostr.ProfilePointer{PublicKey: data.(nostr.PubKey)}
@@ -28,6 +25,7 @@ func InputToProfile(ctx context.Context, input string) *nostr.ProfilePointer {
pp := data.(nostr.ProfilePointer) pp := data.(nostr.ProfilePointer)
return &pp return &pp
} }
}
// handle nip05 ids, if that's the case // handle nip05 ids, if that's the case
pp, _ := nip05.QueryIdentifier(ctx, input) pp, _ := nip05.QueryIdentifier(ctx, input)