Adding WHOWAS command to the client
authorDarren <darren@darrenwhitlen.com>
Sun, 16 Jun 2013 15:52:12 +0000 (16:52 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 16 Jun 2013 15:52:12 +0000 (16:52 +0100)
client/assets/src/models/application.js

index 59b7d262d78a02fa4996b6b22518251e99289af2..59cecf3a14bf9c06f3d5c5085b313c3287bc2f76 100644 (file)
@@ -458,6 +458,8 @@ _kiwi.model.Application = function () {
 \r
             controlbox.on('command:whois', whoisCommand);\r
 \r
+            controlbox.on('command:whowas', whowasCommand);\r
+\r
 \r
             controlbox.on('command:css', function (ev) {\r
                 var queryString = '?reload=' + new Date().getTime();\r
@@ -773,6 +775,20 @@ _kiwi.model.Application = function () {
         }\r
 \r
 \r
+        function whowasCommand (ev) {\r
+            var nick;\r
+\r
+            if (ev.params[0]) {\r
+                nick = ev.params[0];\r
+            } else if (_kiwi.app.panels().active.isQuery()) {\r
+                nick = _kiwi.app.panels().active.get('name');\r
+            }\r
+\r
+            if (nick)\r
+                _kiwi.app.connections.active_connection.gateway.raw('WHOWAS ' + nick);\r
+        }\r
+\r
+\r
         function serverCommand (ev) {\r
             var server, port, ssl, password, nick,\r
                 tmp;\r