Add nick changing support.

This commit is contained in:
Jeremy Latt 2013-05-12 11:20:55 -07:00
parent c42cd92f91
commit fd814bf969
6 changed files with 61 additions and 36 deletions

View file

@ -35,6 +35,16 @@ func (set UserSet) Remove(user *User) {
delete(set, user)
}
func (set UserSet) Nicks() []string {
nicks := make([]string, len(set))
i := 0
for member := range set {
nicks[i] = member.Nick()
i++
}
return nicks
}
func NewUser(nick string, password string, server *Server) *User {
commands := make(chan UserCommand)
replies := make(chan Reply)