channel_prefix may contain more than one prefix
authorDarren <darren@darrenwhitlen.com>
Sun, 2 Mar 2014 12:17:03 +0000 (12:17 +0000)
committerDarren <darren@darrenwhitlen.com>
Sun, 2 Mar 2014 12:17:03 +0000 (12:17 +0000)
client/src/models/network.js

index 987c9321736e90d395568b8b99184f24cb1fab53..2b890abfa0bd022f79b61bf0f4862c546dad1264 100644 (file)
 
                 // Trim any whitespace off the name
                 channel_name = channel_name.trim();
-                
+
                 // Add channel_prefix in front of the first channel if missing
-                if (channel_name[0] != that.get('channel_prefix')) {
-                    channel_name = that.get('channel_prefix') + channel_name;
+                if (that.get('channel_prefix').indexOf(channel_name[0]) === -1) {
+                    // Could be many prefixes but '#' is highly likely the required one
+                    channel_name = '#' + channel_name;
                 }
 
                 // Check if we have the panel already. If not, create it