mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-08-03 08:22:12 +02:00
Add NIP-22 support
This commit is contained in:
24
nip22/nip22.go
Normal file
24
nip22/nip22.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package nip22
|
||||
|
||||
import "github.com/nbd-wtf/go-nostr"
|
||||
|
||||
func GetThreadRoot(tags nostr.Tags) *nostr.Tag {
|
||||
for _, tag := range tags {
|
||||
if tag[0] == "E" || tag[0] == "A" || tag[0] == "I" {
|
||||
return &tag
|
||||
}
|
||||
}
|
||||
empty := nostr.Tag{}
|
||||
return &empty
|
||||
}
|
||||
|
||||
func GetImmediateReply(tags nostr.Tags) *nostr.Tag {
|
||||
for _, tag := range tags {
|
||||
if tag[0] == "e" || tag[0] == "a" || tag[0] == "i" {
|
||||
return &tag
|
||||
}
|
||||
}
|
||||
|
||||
empty := nostr.Tag{}
|
||||
return &empty
|
||||
}
|
Reference in New Issue
Block a user