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

allow NS SESSIONS targeting yourself

This commit is contained in:
Shivaram Lingamneni 2019-12-17 19:15:26 -05:00
parent 3480f124cd
commit b468baa959

View File

@ -802,16 +802,16 @@ func nsSessionsHandler(server *Server, client *Client, command string, params []
target := client target := client
if 0 < len(params) { 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]) target = server.clients.Get(params[0])
if target == nil { if target == nil {
nsNotice(rb, client.t("No such nick")) nsNotice(rb, client.t("No such nick"))
return 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) sessionData, currentIndex := target.AllSessionData(rb.session)