forked from External/ergo
save reply source id at init time for nick changes
This commit is contained in:
parent
261aaa128f
commit
c805006ab8
3 changed files with 36 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue