1
0
Fork 0
forked from External/ergo

save reply source id at init time for nick changes

This commit is contained in:
Jeremy Latt 2014-02-13 10:57:00 -08:00
parent 261aaa128f
commit c805006ab8
3 changed files with 36 additions and 12 deletions

View file

@ -233,11 +233,17 @@ func (m *PassCommand) HandleServer(s *Server) {
func (m *NickCommand) HandleServer(s *Server) {
c := m.Client()
if m.nickname == "" {
c.Reply(ErrNoNicknameGiven(s))
return
}
if s.clients[m.nickname] != nil {
c.Reply(ErrNickNameInUse(s, m.nickname))
return
}
// Make reply before changing nick.
reply := RplNick(c, m.nickname)
s.clients.Remove(c)