X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/445e8592c491438e3ea863c2382ea42b1161fe84..b8a0901fbd9071f54d97e8d61fdabdfc0d4f0a7d:/src/main/java/org/asamk/signal/commands/Commands.java diff --git a/src/main/java/org/asamk/signal/commands/Commands.java b/src/main/java/org/asamk/signal/commands/Commands.java index 85e7af32..a068405a 100644 --- a/src/main/java/org/asamk/signal/commands/Commands.java +++ b/src/main/java/org/asamk/signal/commands/Commands.java @@ -1,16 +1,17 @@ package org.asamk.signal.commands; -import java.util.HashMap; import java.util.Map; +import java.util.TreeMap; public class Commands { - private static final Map commands = new HashMap<>(); + private static final Map commands = new TreeMap<>(); static { addCommand("addDevice", new AddDeviceCommand()); addCommand("block", new BlockCommand()); addCommand("daemon", new DaemonCommand()); + addCommand("getUserStatus", new GetUserStatusCommand()); addCommand("link", new LinkCommand()); addCommand("listContacts", new ListContactsCommand()); addCommand("listDevices", new ListDevicesCommand()); @@ -21,26 +22,35 @@ public class Commands { addCommand("receive", new ReceiveCommand()); addCommand("register", new RegisterCommand()); addCommand("removeDevice", new RemoveDeviceCommand()); + addCommand("remoteDelete", new RemoteDeleteCommand()); addCommand("removePin", new RemovePinCommand()); addCommand("send", new SendCommand()); - addCommand("sendReaction", new SendReactionCommand()); addCommand("sendContacts", new SendContactsCommand()); - addCommand("updateContact", new UpdateContactCommand()); + addCommand("sendReaction", new SendReactionCommand()); + addCommand("sendSyncRequest", new SendSyncRequestCommand()); addCommand("setPin", new SetPinCommand()); addCommand("trust", new TrustCommand()); addCommand("unblock", new UnblockCommand()); addCommand("unregister", new UnregisterCommand()); addCommand("updateAccount", new UpdateAccountCommand()); + addCommand("updateContact", new UpdateContactCommand()); addCommand("updateGroup", new UpdateGroupCommand()); addCommand("updateProfile", new UpdateProfileCommand()); - addCommand("verify", new VerifyCommand()); addCommand("uploadStickerPack", new UploadStickerPackCommand()); + addCommand("verify", new VerifyCommand()); } public static Map getCommands() { return commands; } + public static Command getCommand(String commandKey) { + if (!commands.containsKey(commandKey)) { + return null; + } + return commands.get(commandKey); + } + private static void addCommand(String name, Command command) { commands.put(name, command); }