Write generic messages to the console.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Apr 2013 20:51:31 +0000 (22:51 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Apr 2013 20:51:31 +0000 (22:51 +0200)
src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java

index 74b365a..19d5a2b 100644 (file)
@@ -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
        //