summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/core/auth.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/rbot/core/auth.rb b/lib/rbot/core/auth.rb
index c6c55aff..59bcd54a 100644
--- a/lib/rbot/core/auth.rb
+++ b/lib/rbot/core/auth.rb
@@ -238,10 +238,6 @@ class AuthModule < CoreBotModule
end
def auth_whoami(m, params)
- rep = ""
- # if m.public?
- # rep << m.source.nick << ", "
- # end
m.reply _("you are %{who}") % {
:who => get_botusername_for(m.source).gsub(
/^everyone$/, _("no one that I know")).gsub(
@@ -249,6 +245,19 @@ class AuthModule < CoreBotModule
}
end
+ def auth_whois(m, params)
+ return auth_whoami(m, params) if !m.public?
+ u = m.channel.users[params[:user]]
+
+ return m.reply "I don't see anyone named '#{params[:user]}' here" unless u
+
+ m.reply _("#{params[:user]} is %{who}") % {
+ :who => get_botusername_for(u).gsub(
+ /^everyone$/, _("no one that I know")).gsub(
+ /^owner$/, _("my boss"))
+ }
+ end
+
def help(cmd, topic="")
case cmd
when "login"
@@ -836,6 +845,10 @@ auth.map "whoami",
:action => 'auth_whoami',
:auth_path => '!*!'
+auth.map "who is :user",
+ :action => 'auth_whois',
+ :auth_path => '!*!'
+
auth.map "auth :password",
:action => 'auth_auth',
:public => false,