Fixed receiving messages
This commit is contained in:
parent
ab6d27651e
commit
2436afc8e9
@ -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