sdk: fix InputToProfile() to support nip05 again.
This commit is contained in:
+8
-10
@@ -17,16 +17,14 @@ 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 {
|
||||||
}
|
case "npub":
|
||||||
|
return &nostr.ProfilePointer{PublicKey: data.(nostr.PubKey)}
|
||||||
switch prefix {
|
case "nprofile":
|
||||||
case "npub":
|
pp := data.(nostr.ProfilePointer)
|
||||||
return &nostr.ProfilePointer{PublicKey: data.(nostr.PubKey)}
|
return &pp
|
||||||
case "nprofile":
|
}
|
||||||
pp := data.(nostr.ProfilePointer)
|
|
||||||
return &pp
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle nip05 ids, if that's the case
|
// handle nip05 ids, if that's the case
|
||||||
|
|||||||
Reference in New Issue
Block a user