]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Fix up /join channel to /join #channel.
authorChris Porter <redacted>
Fri, 5 Dec 2008 00:30:36 +0000 (00:30 +0000)
committerChris Porter <redacted>
Fri, 5 Dec 2008 00:30:36 +0000 (00:30 +0000)
Use commandparser for initial autojoin.

js/irc/commandparser.js
js/irc/ircclient.js
js/ui/baseuiwindow.js

index 12ef4bd540fa79ea35bc9d9d236dcb94171e73ab..cdc4e0ae8188b83319280db45b3acabcb22aeb7c 100644 (file)
@@ -281,6 +281,27 @@ qwebirc.irc.CommandParser = new Class({
     this.send("PART " + c + " :" + (args?args[0]:"rejoining. . ."));
     this.send("JOIN " + c);
   }],
+  cmd_JOIN: [false, 2, 1, function(args) {
+    var channels = args.shift();
+    
+    var schans = channels.split(",");
+    var fchans = [];
+    
+    var warn = false;
+    
+    schans.forEach(function(x) {
+      if(!this.parentObject.isChannel(x)) {
+        x = "#" + x;
+        warn = true;
+      }
+      fchans.push(x);
+    }.bind(this));
+
+    if(warn)
+      this.getActiveWindow().infoMessage("Channel names begin with # (corrected automatically).");
+      
+    this.send("JOIN " + fchans.join(",") + " " + args.join(" "));
+  }],
   cmd_UMODE: [false, 1, 0, function(args) {
     this.send("MODE " + this.parentObject.getNickname() + (args?(" " + args[0]):""));
   }],
index b6224be608c8e0f0c3f6b04f8bcfa251c3c575ec..c1955522f1781928306b9f026eba1bd933eacb57 100644 (file)
@@ -177,7 +177,7 @@ qwebirc.irc.IRCClient = new Class({
     this.newServerLine("SIGNON");
     
     if(this.options.autojoin)
-      this.send("JOIN " + this.options.autojoin);
+      this.commandparser.dispatch("/JOIN " + this.options.autojoin);
   },
   userJoined: function(user, channel) {
     var nick = user.hostToNick();
index 01e0ff17c4a906a9827e7c00ab45f906439a28ee..dcdd15f1f37be81fa97a5445538f314e20928f95 100644 (file)
@@ -104,6 +104,9 @@ qwebirc.ui.Window = new Class({
   errorMessage: function(message) {
     this.addLine("", message, "red");
   },
+  infoMessage: function(message) {
+    this.addLine("", message, "        #87CEFA");
+  },
   setHilighted: function(state) {
     if(state == qwebirc.ui.HILIGHT_NONE || state >= this.hilighted)
       this.hilighted = state;