allow NS SESSIONS targeting yourself

This commit is contained in:
Shivaram Lingamneni 2019-12-17 19:15:26 -05:00
parent 3480f124cd
commit b468baa959
1 changed files with 5 additions and 5 deletions

View File

@ -802,16 +802,16 @@ func nsSessionsHandler(server *Server, client *Client, command string, params []
target := client
if 0 < len(params) {
// same permissions check as RPL_WHOISACTUALLY for now:
if !client.HasMode(modes.Operator) {
nsNotice(rb, client.t("Command restricted"))
return
}
target = server.clients.Get(params[0])
if target == nil {
nsNotice(rb, client.t("No such nick"))
return
}
// same permissions check as RPL_WHOISACTUALLY for now:
if target != client && !client.HasMode(modes.Operator) {
nsNotice(rb, client.t("Command restricted"))
return
}
}
sessionData, currentIndex := target.AllSessionData(rb.session)