Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsuen2008-02-10 16:59:11 -0500
committerrsuen2008-02-10 16:59:11 -0500
commit85f13e35d40cd728ed3f98efb424a436b2b8bc72 (patch)
tree49839c7af70d68bf614ed43f18727858dc390bab /applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence
parent94ed24a9eefcd43bd223367e731d7aa31fa4051b (diff)
downloadorg.eclipse.ecf-85f13e35d40cd728ed3f98efb424a436b2b8bc72.tar.gz
org.eclipse.ecf-85f13e35d40cd728ed3f98efb424a436b2b8bc72.tar.xz
org.eclipse.ecf-85f13e35d40cd728ed3f98efb424a436b2b8bc72.zip
Reverting the message handling code so that commands with arguments will work properly.
Diffstat (limited to 'applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence')
-rw-r--r--applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java48
1 files changed, 28 insertions, 20 deletions
diff --git a/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java b/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java
index 9e73c8d14..bd5efcb61 100644
--- a/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java
+++ b/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java
@@ -782,26 +782,34 @@ public class ChatRoomMessageHandler implements IChatRoomMessageHandler {
}
String msg = message.getMessage();
- String upperCase = msg.toUpperCase();
- if (upperCase.startsWith("KOS-MOS:") || upperCase.startsWith("KOS-MOS,")) {
- msg = upperCase.substring(8).trim();
- switch (msg.charAt(0)) {
- case '~':
- case '!':
- handleMessage(fromID, message.getChatRoomID(), msg
- .substring(1).trim());
- break;
- }
- } else {
- String[] split = msg.split("\\s"); //$NON-NLS-1$
- for (int i = 0; i < split.length; i++) {
- if (split[i].length() > 0) {
- switch (split[i].charAt(0)) {
- case '~':
- case '!':
- handleMessage(fromID, message
- .getChatRoomID(), split[i].substring(1).trim());
- break;
+ switch (msg.charAt(0)) {
+ case '~':
+ case '!':
+ handleMessage(fromID, message.getChatRoomID(), msg
+ .substring(1).trim());
+ break;
+ default:
+ String upperCase = msg.toUpperCase();
+ if (upperCase.startsWith("KOS-MOS:") || upperCase.startsWith("KOS-MOS,")) {
+ msg = upperCase.substring(8).trim();
+ switch (msg.charAt(0)) {
+ case '~':
+ case '!':
+ handleMessage(fromID, message.getChatRoomID(), msg
+ .substring(1).trim());
+ break;
+ }
+ } else {
+ String[] split = msg.split("\\s"); //$NON-NLS-1$
+ for (int i = 0; i < split.length; i++) {
+ if (split[i].length() > 0) {
+ switch (split[i].charAt(0)) {
+ case '~':
+ case '!':
+ handleMessage(fromID, message
+ .getChatRoomID(), split[i].substring(1).trim());
+ break;
+ }
}
}
}

Back to the top