From: Darren Date: Mon, 11 Mar 2013 17:47:29 +0000 (+0000) Subject: Warning of joining invalid channel names #169 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ed5e3cf7b5796a1c7359aa0848f1a8bb5dd866ad;p=KiwiIRC.git Warning of joining invalid channel names #169 --- diff --git a/client/assets/dev/model_application.js b/client/assets/dev/model_application.js index be5fbd0..1449e9b 100644 --- a/client/assets/dev/model_application.js +++ b/client/assets/dev/model_application.js @@ -996,6 +996,13 @@ _kiwi.model.Application = function () { // Trim any whitespace off the name channel_name = channel_name.trim(); + // If not a valid channel name, display a warning + if (!that.isChannelName(channel_name)) { + _kiwi.app.panels.server.addMsg('', channel_name + ' is not a valid channel name'); + _kiwi.app.message.text(channel_name + ' is not a valid channel name', {timeout: 5000}); + return; + } + // Check if we have the panel already. If not, create it channel = that.panels.getByName(channel_name); if (!channel) {