Implemented contact removal operation (untested)

This commit is contained in:
Kai S. K. Engelbart 2020-06-09 14:21:11 +02:00
parent 72354b3678
commit d03bbb6f5e

View File

@ -109,10 +109,12 @@ public final class ChatScene {
case ADD:
localDB.getUsers().put(contact.getName(), contact);
localDB.getChats().add(new Chat(contact));
userList.getItems().add(contact);// TODO might cause contact duplication
userList.getItems().add(contact);
break;
case REMOVE:
// TODO add deletion capability
localDB.getUsers().remove(contact.getName());
localDB.getChats().removeIf(c -> c.getRecipient().getID() == contact.getID());
userList.getItems().removeIf(c -> c.getID() == contact.getID());
break;
}
});