mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-11-18 18:16:50 +01:00
move ExternalPointer to nip73 and write nip27.Parse() that gets all the parts of the text including URLs, Nostr URIs and just raw text.
This commit is contained in:
19
pointers.go
19
pointers.go
@@ -26,7 +26,6 @@ var (
|
||||
_ Pointer = (*ProfilePointer)(nil)
|
||||
_ Pointer = (*EventPointer)(nil)
|
||||
_ Pointer = (*EntityPointer)(nil)
|
||||
_ Pointer = (*ExternalPointer)(nil)
|
||||
)
|
||||
|
||||
// ProfilePointer represents a pointer to a Nostr profile.
|
||||
@@ -174,21 +173,3 @@ func (ep EntityPointer) AsTag() Tag {
|
||||
}
|
||||
return Tag{"a", ep.AsTagReference()}
|
||||
}
|
||||
|
||||
// ExternalPointer represents a pointer to a Nostr profile.
|
||||
type ExternalPointer struct {
|
||||
Thing string
|
||||
}
|
||||
|
||||
// ExternalPointerFromTag creates a ExternalPointer from an "i" tag
|
||||
func ExternalPointerFromTag(refTag Tag) (ExternalPointer, error) {
|
||||
return ExternalPointer{refTag[1]}, nil
|
||||
}
|
||||
|
||||
func (ep ExternalPointer) MatchesEvent(_ Event) bool { return false }
|
||||
func (ep ExternalPointer) AsTagReference() string { return ep.Thing }
|
||||
func (ep ExternalPointer) AsFilter() Filter { return Filter{} }
|
||||
|
||||
func (ep ExternalPointer) AsTag() Tag {
|
||||
return Tag{"i", ep.Thing}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user