breaking pointer mess

- ExternalPointer (?)
- nip27, nip22 and nip10 functions to return pointers
- get rid of sdk/thread helpers that were just a thin layer over nip10 and nip22
This commit is contained in:
fiatjaf
2025-03-10 02:35:02 -03:00
parent f575f63f6c
commit 7e04bbb4b8
8 changed files with 119 additions and 79 deletions

View File

@@ -9,8 +9,13 @@ import (
func EncodePointer(pointer nostr.Pointer) string {
switch v := pointer.(type) {
case nostr.ProfilePointer:
res, _ := EncodeProfile(v.PublicKey, v.Relays)
return res
if v.Relays == nil {
res, _ := EncodePublicKey(v.PublicKey)
return res
} else {
res, _ := EncodeProfile(v.PublicKey, v.Relays)
return res
}
case nostr.EventPointer:
res, _ := EncodeEvent(v.ID, v.Relays, v.Author)
return res