From 659da33a8c005e19d69801e00918542d05c9c87b Mon Sep 17 00:00:00 2001 From: Aptimex Date: Thu, 15 Aug 2024 17:58:37 -0600 Subject: [PATCH] working with status --- src/cmd/status.go | 2 +- src/peer/config.go | 4 ++-- src/peer/peer_config.go | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cmd/status.go b/src/cmd/status.go index 592cc5d..ad80a6f 100644 --- a/src/cmd/status.go +++ b/src/cmd/status.go @@ -139,7 +139,7 @@ func (c statusCmdConfig) Run() { e2ee: %v... api: %v - routes: %v `, c.e2eeConfig.GetNickname(), c.relayConfig.GetPublicKey()[:8], c.e2eeConfig.GetPublicKey()[:8], api, strings.Join(ips, ",")))) + routes: %v `, c.peerConfig.GetNickname(), c.relayConfig.GetPublicKey()[:8], c.e2eeConfig.GetPublicKey()[:8], api, strings.Join(ips, ",")))) child, err := t.Child(0) check("could not build tree", err) treeTraversal(node.children[i], child) diff --git a/src/peer/config.go b/src/peer/config.go index 5c35e05..573fb76 100644 --- a/src/peer/config.go +++ b/src/peer/config.go @@ -160,8 +160,8 @@ func ParseConfig(filename string) (c Config, err error) { return c, e } err = c.SetMTU(mtu) - case "nickname": - err = c.SetNickname(value) + //case "nickname": + //err = c.SetNickname(value) } if err != nil { return c, err diff --git a/src/peer/peer_config.go b/src/peer/peer_config.go index b523d74..d9f43ef 100644 --- a/src/peer/peer_config.go +++ b/src/peer/peer_config.go @@ -89,7 +89,10 @@ func GetPeerConfig(args PeerConfigArgs) (PeerConfig, error) { } if args.Nickname != "" { - c.SetNickname(args.Nickname) + err = c.SetNickname(args.Nickname) + if err != nil { + return PeerConfig{}, err + } } return c, nil