diff options
Diffstat (limited to '')
| -rw-r--r-- | app.go | 6 | ||||
| -rw-r--r-- | irc/states.go | 5 | ||||
| -rw-r--r-- | irc/tokens.go | 2 |
3 files changed, 7 insertions, 6 deletions
@@ -100,7 +100,11 @@ func (app *App) handleIRCEvent(ev irc.Event) { } app.win.AddLine(ui.Home, ui.NewLineNow(head, ev.Message)) case irc.RegisteredEvent: - app.win.AddLine(ui.Home, ui.NewLineNow("--", "Connected to the server")) + line := "Connected to the server" + if app.s.Nick() != app.cfg.Nick { + line += " as " + app.s.Nick() + } + app.win.AddLine(ui.Home, ui.NewLineNow("--", line)) if app.cfg.Highlights == nil { app.highlights[0] = app.s.NickCf() } diff --git a/irc/states.go b/irc/states.go index f91266a..0c0478b 100644 --- a/irc/states.go +++ b/irc/states.go @@ -479,10 +479,7 @@ func (s *Session) handleStart(msg Message) (err error) { s.handle(msg) } case errNicknameinuse: - s.nick = s.nick + "_" - s.nickCf = s.nickCf + "_" - - err = s.send("NICK %s\r\n", s.nick) + err = s.send("NICK %s_\r\n", msg.Params[1]) if err != nil { return } diff --git a/irc/tokens.go b/irc/tokens.go index de52ea6..8a89a47 100644 --- a/irc/tokens.go +++ b/irc/tokens.go @@ -236,7 +236,7 @@ func (msg *Message) IsValid() bool { switch msg.Command { case "AUTHENTICATE", "PING", "PONG": return 1 <= len(msg.Params) - case rplEndofnames, rplLoggedout, rplMotd, rplNotopic, rplWelcome, rplYourhost: + case rplEndofnames, rplLoggedout, rplMotd, errNicknameinuse, rplNotopic, rplWelcome, rplYourhost: return 2 <= len(msg.Params) case rplIsupport, rplLoggedin, rplTopic: return 3 <= len(msg.Params) |
