Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-08-22 06:37:28 +0000
committerslewis2007-08-22 06:37:28 +0000
commit656e8c625b8bb129bd1cf48e99c80dcc5803671e (patch)
treefec3c4966d6b550411b33ed8370bab59651f66af /providers/bundles/org.eclipse.ecf.provider.irc.ui
parent9946ee2876d8d29f1538c37d144b3c61fe9e5ae7 (diff)
downloadorg.eclipse.ecf-656e8c625b8bb129bd1cf48e99c80dcc5803671e.tar.gz
org.eclipse.ecf-656e8c625b8bb129bd1cf48e99c80dcc5803671e.tar.xz
org.eclipse.ecf-656e8c625b8bb129bd1cf48e99c80dcc5803671e.zip
Fix for bug 199366
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.irc.ui')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/IRCUI.java39
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java4
2 files changed, 22 insertions, 21 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/IRCUI.java b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/IRCUI.java
index 46bc87cdc..e005c7b77 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/IRCUI.java
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/IRCUI.java
@@ -12,8 +12,6 @@
package org.eclipse.ecf.internal.irc.ui;
-import java.net.URI;
-import java.net.URISyntaxException;
import java.util.StringTokenizer;
import org.eclipse.ecf.core.IContainer;
@@ -57,22 +55,27 @@ public class IRCUI extends ChatRoomManagerUI {
}
protected String[] getRoomsForTarget() {
- String initialRooms = null;
- try {
- URI targetURI = new URI(targetID.getName());
- initialRooms = targetURI.getPath();
- } catch (URISyntaxException e) {
- }
- if (initialRooms == null
- || initialRooms.equals("") || initialRooms.equals("/")) //$NON-NLS-1$
+ String initialChannels = targetID.getName();
+ int protocolSeparator = initialChannels.indexOf("://"); //$NON-NLS-1$
+ if (protocolSeparator != -1) initialChannels = initialChannels.substring(protocolSeparator+3);
+ int index = initialChannels.lastIndexOf("/"); //$NON-NLS-1$
+ if (index != -1) {
+ initialChannels = initialChannels.substring(index+1);
+ while (initialChannels.startsWith("/")) initialChannels = initialChannels.substring(1); //$NON-NLS-1$
+ } else initialChannels = null;
+ if (initialChannels == null
+ || initialChannels.equals("") || initialChannels.equals("/")) //$NON-NLS-1$ //$NON-NLS-2$
return new String[0];
- while (initialRooms.charAt(0) == '/')
- initialRooms = initialRooms.substring(1);
-
- if (initialRooms.startsWith(CHANNEL_PREFIX))
- return new String[] { initialRooms };
- else
- return super.getRoomsForTarget();
+
+ StringTokenizer toks = new StringTokenizer(initialChannels,ROOM_DELIMITER); //$NON-NLS-1$
+ String [] results = new String[toks.countTokens()];
+ for(int i=0; i < results.length; i++) {
+ results[i] = toks.nextToken();
+ if (results[i].startsWith("%23")) { //$NON-NLS-1$
+ results[i] = "#"+results[i].substring(3); //$NON-NLS-1$
+ } else if (!results[i].startsWith("#")) results[i] = "#"+results[i]; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return results;
}
/*
@@ -96,7 +99,7 @@ public class IRCUI extends ChatRoomManagerUI {
System.arraycopy(tokens, 1, args, 0, tokens.length - 1);
// JOIN can be done from root or channel
if (command.equalsIgnoreCase(Messages.IRCUI_JOIN_COMMAND)) {
- chatroomview.joinRoom(manager.getChatRoomInfo(args[0]), (args.length > 1)?args[1]:"");
+ chatroomview.joinRoom(manager.getChatRoomInfo(args[0]), (args.length > 1)?args[1]:""); //$NON-NLS-1$
return null;
}
// QUIT can be done from root or channel
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java
index a48d39535..6711ec537 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java
@@ -139,9 +139,7 @@ final class IRCConnectWizardPage extends WizardPage {
}
String getConnectID() {
- String clean = connectText.getText().replaceAll("#",""); //$NON-NLS-1$ //$NON-NLS-2$
- connectText.setText(clean);
- return clean;
+ return connectText.getText();
}
String getPassword() {

Back to the top