From: David ‘Bombe’ Roden Date: Fri, 17 Oct 2014 07:34:10 +0000 (+0200) Subject: Format printed channels nicely. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7e12b9da7bb49b20e1dbc95de0d89b07d8cda0e4;p=xudocci.git Format printed channels nicely. --- diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 509d30e..0cc8294 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -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("") ))); diff --git a/src/main/java/net/pterodactylus/xdcc/data/Channel.java b/src/main/java/net/pterodactylus/xdcc/data/Channel.java index ffdb6c8..f4c8d01 100644 --- a/src/main/java/net/pterodactylus/xdcc/data/Channel.java +++ b/src/main/java/net/pterodactylus/xdcc/data/Channel.java @@ -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()); + } + }