3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 03:02:48 +01:00

client: HasCapabs -> HasRoleCapabs to make it more clear exactly what this means

This commit is contained in:
Daniel Oaks 2017-09-29 12:11:06 +10:00
parent 810908db7f
commit cea6565b80
2 changed files with 3 additions and 3 deletions

View File

@ -330,8 +330,8 @@ func (client *Client) HasUsername() bool {
return client.username != "" && client.username != "*" return client.username != "" && client.username != "*"
} }
// HasCapabs returns true if client has the given (role) capabilities. // HasRoleCapabs returns true if client has the given (role) capabilities.
func (client *Client) HasCapabs(capabs ...string) bool { func (client *Client) HasRoleCapabs(capabs ...string) bool {
if client.class == nil { if client.class == nil {
return false return false
} }

View File

@ -28,7 +28,7 @@ func (cmd *Command) Run(server *Server, client *Client, msg ircmsg.IrcMessage) b
client.Send(nil, server.name, ERR_NOPRIVILEGES, client.nick, "Permission Denied - You're not an IRC operator") client.Send(nil, server.name, ERR_NOPRIVILEGES, client.nick, "Permission Denied - You're not an IRC operator")
return false return false
} }
if len(cmd.capabs) > 0 && !client.HasCapabs(cmd.capabs...) { if len(cmd.capabs) > 0 && !client.HasRoleCapabs(cmd.capabs...) {
client.Send(nil, server.name, ERR_NOPRIVILEGES, client.nick, "Permission Denied") client.Send(nil, server.name, ERR_NOPRIVILEGES, client.nick, "Permission Denied")
return false return false
} }