From 548b1c693050b9961c8c253ca4e344f8ad8efc48 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 6 Dec 2021 17:58:54 +0100 Subject: [PATCH] Read nickname from RPL_WELCOME References: https://github.com/ircdocs/modern-irc/pull/146 --- upstream.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/upstream.go b/upstream.go index 561da2f..9a683e8 100644 --- a/upstream.go +++ b/upstream.go @@ -690,8 +690,13 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err dc.SendMessage(msg) } case irc.RPL_WELCOME: + if err := parseMessageParams(msg, &uc.nick); err != nil { + return err + } + uc.registered = true - uc.logger.Printf("connection registered") + uc.nickCM = uc.network.casemap(uc.nick) + uc.logger.Printf("connection registered with nick %q", uc.nick) if uc.network.channels.Len() > 0 { var channels, keys []string