From 84c1533b53e11fa02d2cbd68994ada2590867bd1 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 4 Oct 2017 03:14:30 -0400 Subject: [PATCH] review fix: report unfolded nicks in `/monitor l` when possible --- irc/monitor.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/irc/monitor.go b/irc/monitor.go index 2ca2ad01..0f3fb9c5 100644 --- a/irc/monitor.go +++ b/irc/monitor.go @@ -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) }