From 03d851048638e434cf5eb9d65e377d9d0dba9293 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Thu, 12 Jun 2014 14:11:12 +0200 Subject: [PATCH] Added '/whoami' command --- README.md | 1 + client/js/chat.js | 1 + lib/server.js | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d01c46c..59b4513 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ These are the commands currently implemented: - [x] /slap - [x] /topic - [x] /voice +- [x] /whoami - [x] /whois ## Install diff --git a/client/js/chat.js b/client/js/chat.js index 3a16dba..0437e0b 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -30,6 +30,7 @@ $(function() { "/slap", "/topic", "/voice", + "/whoami", "/whois", ]; diff --git a/lib/server.js b/lib/server.js index 922cee7..9764f3c 100644 --- a/lib/server.js +++ b/lib/server.js @@ -280,10 +280,13 @@ function input(data) { } break; + case "whoami": + var user = client.me; case "query": case "whois": - if (client && args[1]) { - client.whois(args[1]); + var user = user || args[1]; + if (client && user) { + client.whois(user); } break;