Warning of joining invalid channel names #169
authorDarren <darren@Darrens-MacBook-Pro.local>
Mon, 11 Mar 2013 17:47:29 +0000 (17:47 +0000)
committerDarren <darren@Darrens-MacBook-Pro.local>
Mon, 11 Mar 2013 17:47:29 +0000 (17:47 +0000)
client/assets/dev/model_application.js

index be5fbd0d5786908fe32f182bb3a6823917a242e4..1449e9b11cd62fff619f038f933820aea93e942c 100644 (file)
@@ -996,6 +996,13 @@ _kiwi.model.Application = function () {
                 // Trim any whitespace off the name\r
                 channel_name = channel_name.trim();\r
 \r
+                // If not a valid channel name, display a warning\r
+                if (!that.isChannelName(channel_name)) {\r
+                    _kiwi.app.panels.server.addMsg('', channel_name + ' is not a valid channel name');\r
+                    _kiwi.app.message.text(channel_name + ' is not a valid channel name', {timeout: 5000});\r
+                    return;\r
+                }\r
+\r
                 // Check if we have the panel already. If not, create it\r
                 channel = that.panels.getByName(channel_name);\r
                 if (!channel) {\r