1
0
Fork 0
forked from External/ergo

RESUME: Fix a few bugs, play modestrings 'n' all

This commit is contained in:
Daniel Oaks 2018-01-22 20:55:20 +10:00
parent f8b39cfe61
commit 0569b5cfaa
2 changed files with 44 additions and 6 deletions

View file

@ -463,6 +463,23 @@ func (server *Server) tryRegister(c *Client) {
}
channel.SendTopic(c)
channel.Names(c)
// construct and send fake modestring if necessary
c.stateMutex.RLock()
myModes := channel.members[c]
c.stateMutex.RUnlock()
if myModes == nil {
continue
}
oldModes := myModes.String()
if 0 < len(oldModes) {
params := []string{channel.name, "+" + oldModes}
for _ = range oldModes {
params = append(params, c.nick)
}
c.Send(nil, server.name, "MODE", params...)
}
}
}
}