Update UI on user status change
This commit is contained in:
parent
6d7afbaa8f
commit
5daff3620e
@ -222,6 +222,11 @@ public final class LocalDB implements EventListener {
|
|||||||
this.<GroupMessage>getMessage(evt.getID()).ifPresent(msg -> msg.getMemberStatuses().replace(evt.getMemberID(), evt.get()));
|
this.<GroupMessage>getMessage(evt.getID()).ifPresent(msg -> msg.getMemberStatuses().replace(evt.getMemberID(), evt.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Event(priority = 150)
|
||||||
|
private void onUserStatusChange(UserStatusChange evt) {
|
||||||
|
this.getChat(evt.getID()).map(Chat::getRecipient).map(User.class::cast).ifPresent(u -> u.setStatus(evt.get()));
|
||||||
|
}
|
||||||
|
|
||||||
@Event(priority = 150)
|
@Event(priority = 150)
|
||||||
private void onGroupResize(GroupResize evt) { getChat(evt.getGroupID()).map(Chat::getRecipient).map(Group.class::cast).ifPresent(evt::apply); }
|
private void onGroupResize(GroupResize evt) { getChat(evt.getGroupID()).map(Chat::getRecipient).map(Group.class::cast).ifPresent(evt::apply); }
|
||||||
|
|
||||||
|
@ -253,15 +253,8 @@ public final class ChatScene implements EventListener, Restorable {
|
|||||||
.ifPresent(msg -> Platform.runLater(messageList::refresh));
|
.ifPresent(msg -> Platform.runLater(messageList::refresh));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Event
|
@Event(eventType = UserStatusChange.class)
|
||||||
private void onUserStatusChange(UserStatusChange evt) {
|
private void onUserStatusChange() { Platform.runLater(chatList::refresh); }
|
||||||
chats.getSource()
|
|
||||||
.stream()
|
|
||||||
.filter(c -> c.getRecipient().getID() == evt.getID())
|
|
||||||
.findAny()
|
|
||||||
.map(Chat::getRecipient)
|
|
||||||
.ifPresent(u -> ((User) u).setStatus(evt.get()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Event
|
@Event
|
||||||
private void onContactOperation(ContactOperation operation) {
|
private void onContactOperation(ContactOperation operation) {
|
||||||
|
Reference in New Issue
Block a user