From 0db58ad73e3e6051b6d462b099ecb52e0b8528bc Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 2 Mar 2014 12:17:03 +0000 Subject: [PATCH] channel_prefix may contain more than one prefix --- client/src/models/network.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/models/network.js b/client/src/models/network.js index 987c932..2b890ab 100644 --- a/client/src/models/network.js +++ b/client/src/models/network.js @@ -167,10 +167,11 @@ // 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 -- 2.25.1