AWAY output in WHOIS
authorDarren <darren@Darrens-MacBook-Pro.local>
Mon, 20 May 2013 12:50:13 +0000 (13:50 +0100)
committerDarren <darren@Darrens-MacBook-Pro.local>
Mon, 20 May 2013 12:50:13 +0000 (13:50 +0100)
client/assets/dev/model_network.js
server/irc/commands.js
server/irc/user.js

index c21f5e896292a0b7f792e71f6676dcdee342f5f2..3c0564491cc5c28803d0d302d93e6c6774d5b8cb 100644 (file)
             logon_date = formatDate(logon_date);
 
             panel.addMsg(event.nick, 'idle for ' + idle_time + ', signed on ' + logon_date, 'whois');
+        } else if (event.away_reason) {
+            panel.addMsg(event.nick, 'Away: ' + event.away_reason, 'whois');
         } else {
             panel.addMsg(event.nick, 'idle for ' + idle_time, 'whois');
         }
index 71b848235b2e533692662909f8c47c78e850a14f..d311f0e76609fa7d249429878df54cc185d7b504 100644 (file)
@@ -14,6 +14,7 @@ var irc_numerics = {
     RPL_LUSERME:            '255',
     RPL_LOCALUSERS:         '265',
     RPL_GLOBALUSERS:        '266',
+    RPL_AWAY:               '301',
     RPL_WHOISREGNICK:       '307',
     RPL_WHOISUSER:          '311',
     RPL_WHOISSERVER:        '312',
@@ -136,6 +137,12 @@ var listeners = {
             msg: command.trailing
         });
     },
+    'RPL_AWAY': function (command) {
+        this.irc_connection.emit('user ' + command.params[1] + ' whoisaway', {
+            nick: command.params[1],
+            reason: command.trailing
+        });
+    },
     'RPL_WHOISUSER': function (command) {
         this.irc_connection.emit('user ' + command.params[1] + ' whoisuser', {
             nick: command.params[1],
index 69dc0a3c747cf2a12a40cb6601113ab04fea8c9c..63c10f5f89305d5760a72c6d2cbb3c93f2019bea 100755 (executable)
@@ -10,6 +10,7 @@ var IrcUser = function (irc_connection, nick) {
         away:           onAway,\r
         quit:           onQuit,\r
         whoisuser:      onWhoisUser,\r
+        whoisaway:      onWhoisAway,\r
         whoisoperator:  onWhoisOperator,\r
         whoischannels:  onWhoisChannels,\r
         whoismodes:     onWhoisModes,\r
@@ -75,6 +76,14 @@ function onWhoisUser(event) {
     });\r
 };\r
 \r
+function onWhoisAway(event) {\r
+    this.irc_connection.clientEvent('whois', {\r
+        nick: event.nick,\r
+        away_reason: event.reason,\r
+        end: false\r
+    });\r
+};\r
+\r
 function onWhoisServer(event) {\r
     this.irc_connection.clientEvent('whois', {\r
         nick: event.nick,\r