diff --git a/src/main/java/fr/imirhil/april/hebdobot/IndividualTopic.java b/src/main/java/fr/imirhil/april/hebdobot/IndividualTopic.java index e9c5a63..1cfe701 100644 --- a/src/main/java/fr/imirhil/april/hebdobot/IndividualTopic.java +++ b/src/main/java/fr/imirhil/april/hebdobot/IndividualTopic.java @@ -31,4 +31,8 @@ public class IndividualTopic extends Topic { public List getMessages(final String author) { return this.messages.get(author); } + + public boolean hasParticipant(final String participant) { + return this.messages.containsKey(participant); + } } diff --git a/src/main/java/fr/imirhil/april/hebdobot/Meeting.java b/src/main/java/fr/imirhil/april/hebdobot/Meeting.java index 75f01d4..8779641 100644 --- a/src/main/java/fr/imirhil/april/hebdobot/Meeting.java +++ b/src/main/java/fr/imirhil/april/hebdobot/Meeting.java @@ -56,11 +56,14 @@ public class Meeting { buffer.append(getLine( Meeting.USER_SERVICE.getRealName(participant), '-')); for (final IndividualTopic topic : this.individualTopics) { - buffer.append("\n"); - buffer.append(getTopic(topic)); - buffer.append("\n"); - for (final Message message : topic.getMessages(participant)) { - buffer.append("* " + message.getContent() + "\n"); + if (topic.hasParticipant(participant)) { + buffer.append("\n"); + buffer.append(getTopic(topic)); + buffer.append("\n"); + for (final Message message : topic + .getMessages(participant)) { + buffer.append("* " + message.getContent() + "\n"); + } } } }