]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Refactor isChannel, also push nicks onto the lastNick stack when we privmsg.
authorChris Porter <redacted>
Sat, 25 Oct 2008 12:16:46 +0000 (13:16 +0100)
committerChris Porter <redacted>
Sat, 25 Oct 2008 12:16:46 +0000 (13:16 +0100)
js/irc/baseircclient.js
js/irc/commandparser.js

index 429f0fd99ef491b2a74e1a9c96d17bb4c3d2837d..c329ec822e2e53c407182b1a60fe17fc3e1a9bdc 100644 (file)
@@ -64,7 +64,10 @@ qwebirc.irc.BaseIRCClient = new Class({
       }
     }
   },
-
+  isChannel: function(target) {
+    var c = target.chatAt(0);
+    return c == '#';
+  },
   irc_RPL_WELCOME: function(prefix, params) {
     this.nickname = params[0];
     
index 103beff635b29d3ac14e26f19d3094af12350a89..65ec8823d665ae8c26d04e653f1d5313e3b73f16 100644 (file)
@@ -125,6 +125,8 @@ qwebirc.irc.CommandParser = new Class({
     var target = args[0];
     var message = args[1];
     
+    if(this.parentObject.isChannel(target))
+      this.parentObject.pushLastNick(target);
     if(this.send("PRIVMSG " + target + " :" + message))
       this.newTargetLine(target, "MSG", message, {});  
   }],
@@ -240,7 +242,7 @@ qwebirc.irc.CommandParser = new Class({
       if(!args || args.length == 0) {
         channel = w.name;
       } else {
-        var isChan = args[0].charAt(0) == '#';
+        var isChan = this.parentObject.isChannel(args[0]);
         if(isChan) {
           channel = args[0];
           if(args.length > 1)