From cea6565b80e92a87b6eadcac8452230c502d886e Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Fri, 29 Sep 2017 12:11:06 +1000 Subject: [PATCH] client: HasCapabs -> HasRoleCapabs to make it more clear exactly what this means --- irc/client.go | 4 ++-- irc/commands.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/irc/client.go b/irc/client.go index 4eb65c57..f19c0467 100644 --- a/irc/client.go +++ b/irc/client.go @@ -330,8 +330,8 @@ func (client *Client) HasUsername() bool { return client.username != "" && client.username != "*" } -// HasCapabs returns true if client has the given (role) capabilities. -func (client *Client) HasCapabs(capabs ...string) bool { +// HasRoleCapabs returns true if client has the given (role) capabilities. +func (client *Client) HasRoleCapabs(capabs ...string) bool { if client.class == nil { return false } diff --git a/irc/commands.go b/irc/commands.go index c20e7b61..429bd6f0 100644 --- a/irc/commands.go +++ b/irc/commands.go @@ -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") 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") return false }