From ffaba5e25d23d8f46cc7c1dc968341c941927f16 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Thu, 18 Mar 2010 00:14:29 +0100 Subject: [PATCH] Send unknown commands to the server --- src/org/yaaic/command/CommandParser.java | 25 +++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/org/yaaic/command/CommandParser.java b/src/org/yaaic/command/CommandParser.java index 7074758..c994c3a 100644 --- a/src/org/yaaic/command/CommandParser.java +++ b/src/org/yaaic/command/CommandParser.java @@ -151,15 +151,22 @@ public class CommandParser } } else { // Unknown command - if (conversation != null) { - Message message = new Message("Unknown command: " + type); - message.setColor(Message.COLOR_RED); - conversation.addMessage(message); - - Intent intent = new Intent(Broadcast.CONVERSATION_MESSAGE); - intent.putExtra(Broadcast.EXTRA_SERVER, server.getId()); - intent.putExtra(Broadcast.EXTRA_CONVERSATION, conversation.getName()); - service.sendBroadcast(intent); + if (params.length > 1) { + // Send command to server + service.getConnection(server.getId()).sendRawLineViaQueue( + params[0].toUpperCase() + " " + BaseHandler.mergeParams(params) + ); + } else { + if (conversation != null) { + Message message = new Message("Unknown command: " + type); + message.setColor(Message.COLOR_RED); + conversation.addMessage(message); + + Intent intent = new Intent(Broadcast.CONVERSATION_MESSAGE); + intent.putExtra(Broadcast.EXTRA_SERVER, server.getId()); + intent.putExtra(Broadcast.EXTRA_CONVERSATION, conversation.getName()); + service.sendBroadcast(intent); + } } } }