WHOIS fixes.
authorJack Allnutt <m2ys4u@Gmail.com>
Sat, 6 Oct 2012 14:20:35 +0000 (15:20 +0100)
committerJack Allnutt <m2ys4u@Gmail.com>
Sat, 6 Oct 2012 14:20:35 +0000 (15:20 +0100)
Fixes bug #83 - Whois data: nick should be blank or of the person being whoised
Fixes bug #84 - Whois: Idle time is not being shown

client_backbone/dev/model_application.js
server/irc-commands.js

index d54d0188e4c772cd541157e91efa4cf93fb56e52..d1b8c2fc9f8a7ded6a9fa474d2a21cf0acc675a7 100755 (executable)
@@ -521,12 +521,18 @@ kiwi.model.Application = Backbone.Model.extend(new (function () {
             }\r
 \r
             panel = kiwi.app.panels.active;\r
-            if (event.msg) {\r
+            if (event.ident) {\r
+                panel.addMsg(event.nick, 'is ' + event.nick + '!' + event.ident + '@' + event.host + ' * ' + event.msg, 'whois');\r
+            } else if (event.chans) {\r
+                panel.addMsg(event.nick, 'on ' + event.chans, 'whois');\r
+            } else if (event.server) {\r
+                panel.addMsg(event.nick, 'using ' + event.server, 'whois');\r
+            } else if (event.msg) {\r
                 panel.addMsg(event.nick, event.msg, 'whois');\r
             } else if (event.logon) {\r
                 logon_date = new Date();\r
                 logon_date.setTime(event.logon * 1000);\r
-                logon_date = formateDate(logon_date);\r
+                logon_date = logon_date.toLocaleDateString() + ', ' + logon_date.getHours().toString() + ':' + logon_date.getMinutes().toString() + ':' + logon_date.getSeconds().toString();\r
 \r
                 panel.addMsg(event.nick, 'idle for ' + idle_time + ', signed on ' + logon_date, 'whois');\r
             } else {\r
index fb72fe72bae2abfe5b929c38bb9dfeb2f4d66dc3..bacca056d91cfe1b14369ee3e4c542ae31d1e051 100755 (executable)
@@ -101,49 +101,53 @@ var listeners = {
                                command.command = 'RPL_ENDOFWHOIS';
                                this.client.sendIRCCommand(command);*/
                 //websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: true});
-                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[0], msg: command.trailing, end: true});
+                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[1], msg: command.trailing, end: true});
             },
     'RPL_WHOISUSER':          function (command) {
                                /*command.server = this.con_num;
                                command.command = 'RPL_WHOISUSER';
                                this.client.sendIRCCommand(command);*/
                 //websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
-                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[0], msg: command.trailing, end: false});
+                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[1], ident: command.params[2], host: command.params[3], msg: command.trailing, end: false});
             },
     'RPL_WHOISSERVER':        function (command) {
                                /*command.server = this.con_num;
                                command.command = 'RPL_WHOISSERVER';
                                this.client.sendIRCCommand(command);*/
                 //websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
-                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[0], msg: command.trailing, end: false});
+                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[1], server: command.params[2], end: false});
             },
     'RPL_WHOISOPERATOR':      function (command) {
                                /*command.server = this.con_num;
                                command.command = 'RPL_WHOISOPERATOR';
                                this.client.sendIRCCommand(command);*/
                 //websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
-                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[0], msg: command.trailing, end: false});
+                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[1], msg: command.trailing, end: false});
             },
     'RPL_WHOISCHANNELS':      function (command) {
                                /*command.server = this.con_num;
                                command.command = 'RPL_WHOISCHANNELS';
                                this.client.sendIRCCommand(command);*/
                 //websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
-                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[0], msg: command.trailing, end: false});
+                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[1], chans: command.trailing, end: false});
             },
     'RPL_WHOISMODES':         function (command) {
                                /*command.server = this.con_num;
                                command.command = 'RPL_WHOISMODES';
                                this.client.sendIRCCommand(command);*/
                 //websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
-                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[0], msg: command.trailing, end: false});
+                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[1], msg: command.trailing, end: false});
             },
     'RPL_WHOISIDLE':          function (command) {
                                /*command.server = this.con_num;
                                command.command = 'RPL_WHOISIDLE';
                                this.client.sendIRCCommand(command);*/
                 //websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
-                this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[0], msg: command.trailing, end: false});
+                if (command.params[3]) {
+                    this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[1], idle: command.params[2], logon: command.params[3], end: false});
+                } else {
+                    this.client.sendIRCCommand('whois', {server: this.con_num, nick: command.params[1], idle: command.params[2], end: false});
+                }
             },
     'RPL_LISTSTART':          function (command) {
                                /*command.server = this.con_num;