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