mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-17 19:13:56 +02:00
some changes and fixes related to sub.Sub().
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func queryName(fullname string) string {
|
||||
func QueryIdentifier(fullname string) string {
|
||||
spl := strings.Split(fullname, "@")
|
||||
if len(spl) != 2 {
|
||||
return ""
|
||||
@@ -30,3 +30,11 @@ func queryName(fullname string) string {
|
||||
pubkey, _ := result.Names[name]
|
||||
return pubkey
|
||||
}
|
||||
|
||||
func NormalizeIdentifier(fullname string) string {
|
||||
if strings.HasPrefix(fullname, "_@") {
|
||||
return fullname[2:]
|
||||
}
|
||||
|
||||
return fullname
|
||||
}
|
||||
|
Reference in New Issue
Block a user