3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-29 07:29:31 +01:00

monitor: Fix target output when adding targets

This commit is contained in:
Daniel Oaks 2017-10-04 18:54:02 +10:00
parent d39ee2fafa
commit 04d5d2fcc2

View File

@ -166,7 +166,7 @@ func monitorAddHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bo
}
// add target
casefoldedTarget, err := CasefoldName(targets[0])
casefoldedTarget, err := CasefoldName(target)
if err != nil {
continue
}
@ -180,10 +180,10 @@ func monitorAddHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bo
}
// add to online / offline lists
if target := server.clients.Get(casefoldedTarget); target == nil {
offline = append(offline, targets[0])
if targetClient := server.clients.Get(casefoldedTarget); targetClient == nil {
offline = append(offline, target)
} else {
online = append(online, target.getNick())
online = append(online, targetClient.getNick())
}
}