Skip to content

Commit

Permalink
Read nickname from RPL_WELCOME
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Dec 6, 2021
1 parent 1c285a1 commit 548b1c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 548b1c6

Please sign in to comment.