mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-18 13:53:03 +01:00
24 lines
501 B
Go
24 lines
501 B
Go
|
package sdk
|
||
|
|
||
|
import (
|
||
|
"github.com/nbd-wtf/go-nostr"
|
||
|
"github.com/nbd-wtf/go-nostr/nip10"
|
||
|
"github.com/nbd-wtf/go-nostr/nip22"
|
||
|
)
|
||
|
|
||
|
func GetThreadRoot(evt *nostr.Event) *nostr.Tag {
|
||
|
if evt.Kind == nostr.KindComment {
|
||
|
return nip22.GetThreadRoot(evt.Tags)
|
||
|
} else {
|
||
|
return nip10.GetThreadRoot(evt.Tags)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func GetImmediateReply(evt *nostr.Event) *nostr.Tag {
|
||
|
if evt.Kind == nostr.KindComment {
|
||
|
return nip22.GetImmediateReply(evt.Tags)
|
||
|
} else {
|
||
|
return nip10.GetImmediateReply(evt.Tags)
|
||
|
}
|
||
|
}
|