mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-11-15 16:50:16 +01:00
nip29: fix printing of GroupAddress.
This commit is contained in:
@@ -2,6 +2,7 @@ package nip29
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
@@ -12,7 +13,10 @@ type GroupAddress struct {
|
|||||||
ID string
|
ID string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gid GroupAddress) String() string { return fmt.Sprintf("%s'%s", gid.ID, gid.Relay) }
|
func (gid GroupAddress) String() string {
|
||||||
|
p, _ := url.Parse(gid.Relay)
|
||||||
|
return fmt.Sprintf("%s'%s", gid.ID, p.Host)
|
||||||
|
}
|
||||||
|
|
||||||
func (gid GroupAddress) IsValid() bool {
|
func (gid GroupAddress) IsValid() bool {
|
||||||
return gid.Relay != "" && gid.ID != ""
|
return gid.Relay != "" && gid.ID != ""
|
||||||
|
|||||||
Reference in New Issue
Block a user