Skip to content
Snippets Groups Projects
Commit 05be0039 authored by Alexis Durgnat's avatar Alexis Durgnat :milky_way:
Browse files

Commands

parent 22d875b0
No related branches found
No related tags found
1 merge request!21*poof* final version
......@@ -26,8 +26,9 @@ public final class AppConfig {
public static List<String> CHAT_COMMANDS = List.of(
"help",
"ignore",
"ignoredlist"
"block",
"unblock",
"blacklist"
);
/**
......
......@@ -320,14 +320,14 @@ public class MainWindowController implements Initializable {
case "help":
drawCommands();
break;
case "ignore":
case "block":
if (command.length > 1) {
Main.getContext().getUser().get().addIgnoredUser(new User(command[1]));
drawMessage(command[1] + " bloqué.",
AppConfig.HELP_MESSAGE_ICON, c);
}
break;
case "ignoredlist":
case "blacklist":
List<User> list = Main.getContext().getUser().get().getIgnoredUserList();
if (list.size() > 0) {
StringBuilder buffer = new StringBuilder(list.get(0).getName());
......@@ -338,6 +338,10 @@ public class MainWindowController implements Initializable {
AppConfig.HELP_MESSAGE_ICON, c);
}
break;
case "unblock":
List<User> ulist = Main.getContext().getUser().get().getIgnoredUserList();
ulist.remove(new User(command[1]));
break;
}
} else {
drawCommands();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment