From 19d9174f1361ffb0f7f8aa2f158248617205f43b Mon Sep 17 00:00:00 2001 From: Juby210 Date: Wed, 12 Aug 2020 20:02:29 +0200 Subject: [PATCH] add ctc commands and subcommands to autocomplete --- patches/slashcommands/1223.patch | 281 ++++++++++++++++++++++++++++++- patches/slashcommands/README.md | 1 - 2 files changed, 277 insertions(+), 5 deletions(-) diff --git a/patches/slashcommands/1223.patch b/patches/slashcommands/1223.patch index 988fbe5..dc0b6ba 100644 --- a/patches/slashcommands/1223.patch +++ b/patches/slashcommands/1223.patch @@ -1,6 +1,6 @@ diff -crB from/smali/com/discord/stores/StoreMessages.smali to/smali/com/discord/stores/StoreMessages.smali -*** from/smali/com/discord/stores/StoreMessages.smali 2020-08-09 14:14:55.960000000 +0300 ---- to/smali/com/discord/stores/StoreMessages.smali 2020-08-09 14:15:35.250000000 +0300 +*** from/smali/com/discord/stores/StoreMessages.smali Wed Aug 12 18:07:38 2020 +--- to/smali/com/discord/stores/StoreMessages.smali Wed Aug 12 19:30:34 2020 *************** *** 922,927 **** --- 922,931 ---- @@ -3330,9 +3330,282 @@ diff -crB from/smali/com/discord/stores/StoreMessages.smali to/smali/com/discord + :cond_0 + return-object p0 + .end method +diff -crB from/smali/com/discord/widgets/chat/input/WidgetChatInputCommandsModel.smali to/smali/com/discord/widgets/chat/input/WidgetChatInputCommandsModel.smali +*** from/smali/com/discord/widgets/chat/input/WidgetChatInputCommandsModel.smali Wed Aug 12 18:07:40 2020 +--- to/smali/com/discord/widgets/chat/input/WidgetChatInputCommandsModel.smali Wed Aug 12 19:49:34 2020 +*************** +*** 835,843 **** + .line 5 + invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; + +! move-result-object v1 + +! invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z + + return-object v0 + .end method +--- 835,1067 ---- + .line 5 + invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; + +! move-result-object v2 + +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! # ctc commands +! +! const-string v2, "lenny" +! +! const-string v3, "( ͡° ͜ʖ ͡°)" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "upper" +! +! const-string v3, "{CTC_COMMAND}" +! +! const-string v4, "Makes text uppercase" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "lower" +! +! const-string v4, "Makes text lowercase" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "bold" +! +! const-string v4, "Makes text bold" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "spoiler" +! +! const-string v4, "Marks your message as a spoiler" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "spoilerimg" +! +! const-string v4, "Prepends SPOILER_ to names of all images attached to the message that starts with this, causing them to get marked as spoiler" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "me" +! +! const-string v4, "Display text with emphasis" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "st" +! +! const-string v4, "Puts a strikethrough the message" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "owo" +! +! const-string v4, "Myakes tyext reawwy owo-ly, nya :3" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "fw" +! +! const-string v4, "Makes text fullwidth (like “Sent from my Android Device”)" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "gordon" +! +! const-string v4, "𝗛𝗲𝗹𝗹𝗼,𝗚𝗼𝗿𝗱𝗼𝗻!" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "small" +! +! const-string v4, "Makes text smaller (like “ᴛʜɪs”)" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "smaller" +! +! const-string v4, "Makes text even smaller (like “ᵗʰvˢ”)" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "flip" +! +! const-string v4, "Flips text (like “ʇɥıs”)" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "clap" +! +! const-string v4, "Please 👏 clap" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "ctc channelleak" +! +! const-string v4, "Shows all channels, even those you don’t have permissions to view" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "ctc notyping" +! +! const-string v4, "Disables typing event so that it’s not visible when you type" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "ctc nodelete" +! +! const-string v4, "Disables handling of message delete events" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "ctc gifautoplay" +! +! const-string v4, "Disables auto play of GIFs" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "ctc token" +! +! const-string v4, "Gives or sets token" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "ctc addaccount" +! +! const-string v4, "Adds an account to the account switcher" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z +! +! const-string v2, "ctc account" +! +! const-string v4, "Switches to the account" +! +! invoke-static {v2, v3, v4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->createSlashCommand(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/discord/widgets/chat/input/WidgetChatInputSlashAction;)Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel; +! +! move-result-object v2 +! +! invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z + + return-object v0 + .end method +*************** +*** 1503,1508 **** +--- 1727,1738 ---- + .locals 2 + + .line 1 ++ iget-object v0, p1, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->slashOutput:Ljava/lang/String; ++ ++ const-string v1, "{CTC_COMMAND}" ++ ++ if-eq v0, v1, :cond_0 ++ + iget-object v0, p1, Lcom/discord/widgets/chat/input/WidgetChatInputCommandsModel;->tag:Ljava/lang/String; + + const-string v1, "" +*************** +*** 1530,1535 **** +--- 1760,1766 ---- + + move-result-object p0 + ++ :cond_0 + return-object p0 + .end method + diff -crB from/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali to/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali -*** from/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali 2020-08-09 14:14:56.710000000 +0300 ---- to/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali 2020-08-09 14:34:47.100000000 +0300 +*** from/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali Wed Aug 12 18:07:40 2020 +--- to/smali/com/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1.smali Wed Aug 12 19:19:05 2020 *************** *** 693,698 **** --- 693,728 ---- diff --git a/patches/slashcommands/README.md b/patches/slashcommands/README.md index cbc65a8..9e3c255 100644 --- a/patches/slashcommands/README.md +++ b/patches/slashcommands/README.md @@ -37,7 +37,6 @@ Commands like fw can be generated by `textreplacegen.py` or `textreplacegen-arra ## Known bugs - There's no help. -- The slashcommands do not show when putting a slash (which was added in I think 9.7.2). - Output from /ctc commands doesn't get properly displayed if enter is not pressed using a physical keyboard (usb or bluetooth). This is bizarre and oh god please help me solve this bug. #### Available and tested on: