]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Add /away, away notification to active window, /topic and /cycle.
authorChris Porter <redacted>
Mon, 20 Oct 2008 01:02:35 +0000 (02:02 +0100)
committerChris Porter <redacted>
Mon, 20 Oct 2008 01:02:35 +0000 (02:02 +0100)
js/irc/baseircclient.js
js/irc/commandparser.js
js/irc/ircclient.js
js/irc/numerics.js
js/ui/theme.js

index ee85f4d12126e74e46a5c26157db24afe0392824..d53c261cbbad93c9cd5fa3454e8786780ccee2c0 100644 (file)
@@ -393,5 +393,11 @@ qwebirc.irc.BaseIRCClient = new Class({
       
     this.awayMessage(nick, text);
     return true;
+  },
+  irc_RPL_NOWAWAY: function(prefix, params) {
+    this.awayStatus(true, params.indexFromEnd(-1));
+  },
+  irc_RPL_UNAWAY: function(prefix, params) {
+    this.awayStatus(false, params.indexFromEnd(-1));
   }
 });
index 2f73c2e1319894cb37acfb86b7bcfe47dff97064..f7c8a23a5b773ff39c279663a69da6acf8e13752 100644 (file)
@@ -4,7 +4,9 @@ qwebirc.irc.CommandParser = new Class({
       "J": "JOIN",
       "K": "KICK",
       "MSG": "PRIVMSG",
-      "Q": "QUERY"
+      "Q": "QUERY",
+      "BACK": "AWAY",
+      "HOP": "CYCLE"
     };
     
     this.send = parentObject.send;
@@ -201,6 +203,18 @@ qwebirc.irc.CommandParser = new Class({
   cmd_DEVOICE: [true, 6, 1, function(args) {
     this.automode("-", "v", args);
   }],
+  cmd_TOPIC: [true, 1, 1, function(args) {
+    this.send("TOPIC " + this.parentObject.getActiveWindow().name + " :" + args[0]);
+  }],
+  cmd_AWAY: [false, 1, 0, function(args) {
+    this.send("AWAY :" + (args?args[0]:""));
+  }],
+  cmd_CYCLE: [true, 1, 0, function(args) {
+    var c = this.parentObject.getActiveWindow().name;
+    
+    this.send("PART " + c + " :" + (args?args[0]:"rejoining. . ."));
+    this.send("JOIN " + c);
+  }],
   cmd_PART: [false, 2, 0, function(args) {
     var w = this.parentObject.getActiveWindow();
     var message = "";
index b659450f4df64df72a6d248fc299737b0881f354..45ce5dd318d1785dc045cf00ba77d2429016c7b3 100644 (file)
@@ -424,5 +424,8 @@ qwebirc.irc.IRCClient = new Class({
   },
   genericerror: function(target, message) {
     this.newTargetOrActiveLine(target, "GENERICERROR", {m: message, t: target});
+  },
+  awayStatus: function(state, message) {
+    this.newActiveLine("GENERICMESSAGE", {m: message});
   }
 });
index 741c7a9fc49e82d96fc98cc622a1c499e6658e39..30abc9a88df5c54a37222c1205470025891e2c97 100644 (file)
@@ -20,5 +20,7 @@ qwebirc.irc.Numerics = {
   "301": "RPL_AWAY",
   "401": "ERR_NOSUCHNICK",
   "404": "ERR_CANNOTSENDTOCHAN",
-  "482": "ERR_CHANOPPRIVSNEEDED"
+  "482": "ERR_CHANOPPRIVSNEEDED",
+  "305": "RPL_UNAWAY",
+  "306": "RPL_NOWAWAY"
 };
index bf12f261b8194e881283ca9f5a01485015c0ff8b..078a77ca2a962c9d69d4bc9c461771457903a923 100644 (file)
@@ -56,7 +56,8 @@ qwebirc.ui.themes.Default = {
   "WHOISACTUALLY": [" realhost : $m [ip: $x]", true],
   "WHOISEND": ["End of WHOIS", true],
   "AWAY": ["$n is away: $m", true],
-  "GENERICERROR": ["$m: $t", true]
+  "GENERICERROR": ["$m: $t", true],
+  "GENERICMESSAGE": ["$m", true],
 };
 
 qwebirc.ui.Theme = new Class({