Fixed receiving messages
This commit is contained in:
parent
8e449d150b
commit
2fb419b0e7
@ -203,7 +203,7 @@ public class ChatWindow extends JFrame {
|
|||||||
// Listen to received messages
|
// Listen to received messages
|
||||||
EventBus.getInstance().register(MessageCreationEvent.class, (evt) -> {
|
EventBus.getInstance().register(MessageCreationEvent.class, (evt) -> {
|
||||||
Message message = ((MessageCreationEvent) evt).get();
|
Message message = ((MessageCreationEvent) evt).get();
|
||||||
localDB.getChats().stream().filter(c -> c.getRecipient().getId() == message.getRecipientId()).findFirst().get().appendMessage(message);
|
localDB.getChats().stream().filter(c -> c.getRecipient().getId() == message.getSenderId()).findFirst().get().appendMessage(message);
|
||||||
revalidate();
|
revalidate();
|
||||||
repaint();
|
repaint();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user