From 1685ba23b35c0507f149d7f2acb9ed626b7149de Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 6 Jul 2020 18:13:40 +0200 Subject: [PATCH] Strip network name from nickname when auto-saving network --- downstream.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/downstream.go b/downstream.go index 9cca6c0..60c8572 100644 --- a/downstream.go +++ b/downstream.go @@ -753,11 +753,16 @@ func (dc *downstreamConn) loadNetwork() error { }} } + // Some clients only allow specifying the nickname (and use the + // nickname as a username too). Strip the network name from the + // nickname when auto-saving networks. + nick, _, _ := unmarshalUsername(dc.nick) + dc.logger.Printf("auto-saving network %q", dc.networkName) var err error network, err = dc.user.createNetwork(&Network{ Addr: dc.networkName, - Nick: dc.nick, + Nick: nick, }) if err != nil { return err