From 7e12b9da7bb49b20e1dbc95de0d89b07d8cda0e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 Oct 2014 09:34:10 +0200 Subject: [PATCH] Format printed channels nicely. --- src/main/java/net/pterodactylus/xdcc/core/Core.java | 8 ++++---- src/main/java/net/pterodactylus/xdcc/data/Channel.java | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) 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()); + } + } -- 2.7.4