From: David ‘Bombe’ Roden Date: Thu, 11 Apr 2013 20:51:31 +0000 (+0200) Subject: Write generic messages to the console. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0eeb3fd7d28596456705650c7887b164e235b1da;p=xudocci.git Write generic messages to the console. --- diff --git a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java index 74b365a..19d5a2b 100644 --- a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java +++ b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java @@ -32,6 +32,7 @@ import net.pterodactylus.xdcc.core.Core; import net.pterodactylus.xdcc.core.event.DownloadFailed; import net.pterodactylus.xdcc.core.event.DownloadFinished; import net.pterodactylus.xdcc.core.event.DownloadStarted; +import net.pterodactylus.xdcc.core.event.GenericMessage; import net.pterodactylus.xdcc.core.event.MessageReceived; import net.pterodactylus.xdcc.data.Bot; import net.pterodactylus.xdcc.data.Download; @@ -224,6 +225,21 @@ public class CommandReader extends AbstractExecutionThreadService { } } + /** + * Writes a generic message to the console. + * + * @param genericMessage + * The generic message event + */ + @Subscribe + public void genericMessage(GenericMessage genericMessage) { + try { + writeLine(genericMessage.message()); + } catch (IOException ioe1) { + /* ignore. */ + } + } + // // PRIVATE METHODS //