3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +01:00

review fix: report unfolded nicks in /monitor l when possible

This commit is contained in:
Shivaram Lingamneni 2017-10-04 03:14:30 -04:00
parent 3877db2391
commit 84c1533b53

View File

@ -208,7 +208,17 @@ func monitorClearHandler(server *Server, client *Client, msg ircmsg.IrcMessage)
func monitorListHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
monitorList := server.monitorManager.List(client)
for _, line := range argsToStrings(maxLastArgLength, monitorList, ",") {
var nickList []string
for _, cfnick := range(monitorList) {
replynick := cfnick
// report the uncasefolded nick if it's available, i.e., the client is online
if mclient := server.clients.Get(cfnick); mclient != nil {
replynick = mclient.getNick()
}
nickList = append(nickList, replynick)
}
for _, line := range argsToStrings(maxLastArgLength, nickList, ",") {
client.Send(nil, server.name, RPL_MONLIST, client.getNick(), line)
}