From ed5e3cf7b5796a1c7359aa0848f1a8bb5dd866ad Mon Sep 17 00:00:00 2001 From: Darren Date: Mon, 11 Mar 2013 17:47:29 +0000 Subject: [PATCH] Warning of joining invalid channel names #169 --- client/assets/dev/model_application.js | 7 +++++++ 1 file changed, 7 insertions(+) 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) { -- 2.25.1