From: Chris Porter Date: Fri, 5 Dec 2008 00:30:36 +0000 (+0000) Subject: Fix up /join channel to /join #channel. X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/commitdiff_plain/0acc3c540c0b1d5439238be786b43adb43015d35 Fix up /join channel to /join #channel. Use commandparser for initial autojoin. --- diff --git a/js/irc/commandparser.js b/js/irc/commandparser.js index 12ef4bd..cdc4e0a 100644 --- a/js/irc/commandparser.js +++ b/js/irc/commandparser.js @@ -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]):"")); }], diff --git a/js/irc/ircclient.js b/js/irc/ircclient.js index b6224be..c195552 100644 --- a/js/irc/ircclient.js +++ b/js/irc/ircclient.js @@ -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(); diff --git a/js/ui/baseuiwindow.js b/js/ui/baseuiwindow.js index 01e0ff1..dcdd15f 100644 --- a/js/ui/baseuiwindow.js +++ b/js/ui/baseuiwindow.js @@ -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;