diff --git a/src/main/java/envoy/client/ui/ChatWindow.java b/src/main/java/envoy/client/ui/ChatWindow.java index 8f11ec2..cce9e73 100644 --- a/src/main/java/envoy/client/ui/ChatWindow.java +++ b/src/main/java/envoy/client/ui/ChatWindow.java @@ -233,14 +233,12 @@ public class ChatWindow extends JFrame { new Timer(5000, (evt) -> { Messages unreadMessages = client.getUnreadMessages(client.getSender().getID()); - System.out.println(unreadMessages.getMessage().get(0)); - for (int i = 0; i < unreadMessages.getMessage().size(); i++) { - for (int j = 0; j < partnerChatList.size(); j++) { - if(partnerChatList.get(j).getRecipient().getID() == unreadMessages.getMessage().get(i).getMetaData().getSender()) { + for (int i = 0; i < unreadMessages.getMessage().size(); i++) + for (int j = 0; j < partnerChatList.size(); j++) + if (partnerChatList.get(j) + .getRecipient() + .getID() == unreadMessages.getMessage().get(i).getMetaData().getSender()) partnerChatList.get(j).appendMessage(unreadMessages.getMessage().get(i)); - } - } - } }).start(); contentPane.revalidate(); } diff --git a/src/main/java/envoy/client/ui/MessageListRenderer.java b/src/main/java/envoy/client/ui/MessageListRenderer.java index ad965c4..a61ae5f 100644 --- a/src/main/java/envoy/client/ui/MessageListRenderer.java +++ b/src/main/java/envoy/client/ui/MessageListRenderer.java @@ -33,12 +33,15 @@ public class MessageListRenderer extends JLabel implements ListCellRenderer

%s

%s", - new SimpleDateFormat("dd.MM.yyyy hh:mm ") - .format(value.getMetaData().getDate().toGregorianCalendar().getTime()), - value.getContent().get(0).getText())); - + date, + text)); return this; } }