Format printed channels nicely.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 Oct 2014 07:34:10 +0000 (09:34 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 Oct 2014 07:37:42 +0000 (09:37 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java
src/main/java/net/pterodactylus/xdcc/data/Channel.java

index 509d30e..0cc8294 100644 (file)
@@ -546,8 +546,8 @@ public class Core extends AbstractExecutionThreadService {
                }
 
                eventBus.post(new GenericMessage(
-                               format("Could not join %s/%s: %s", channelNotJoined.channel(),
-                                               network.get(), channelNotJoined.reason())));
+                               format("Could not join %s: %s", channelNotJoined.channel(),
+                                               channelNotJoined.reason())));
        }
 
        /**
@@ -613,8 +613,8 @@ public class Core extends AbstractExecutionThreadService {
                                channels.remove(channel.get());
                        }
                        eventBus.post(new GenericMessage(format(
-                                       "Kicked from %s/%s by %s: %s",
-                                       kickedFromChannel.channel(), network.get(),
+                                       "Kicked from %s by %s: %s",
+                                       kickedFromChannel.channel(),
                                        kickedFromChannel.kicker(),
                                        kickedFromChannel.reason().or("<unknown>")
                        )));
index ffdb6c8..f4c8d01 100644 (file)
@@ -17,6 +17,8 @@
 
 package net.pterodactylus.xdcc.data;
 
+import static java.lang.String.format;
+
 import com.google.common.base.Function;
 
 /**
@@ -99,4 +101,9 @@ public class Channel {
                return network().hashCode() ^ name().hashCode();
        }
 
+       @Override
+       public String toString() {
+               return format("%s/%s", name(), network().name());
+       }
+
 }