Strip network name from nickname when auto-saving network

git-svn-id: file:///srv/svn/repo/suika/trunk@354 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This commit is contained in:
contact 2020-07-06 16:13:40 +00:00
parent e55e59080e
commit 6ba63d0774

View File

@ -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