From ddcb459df4f74e15fc6f4b446fac2b13e2d342d1 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Sun, 26 May 2019 16:46:38 +0300 Subject: [PATCH] Move notyping inside of slashcommands --- {patches => old-patches}/notyping/836.patch | 0 {patches => old-patches}/notyping/839.patch | 0 {patches => old-patches}/notyping/841.patch | 0 {patches => old-patches}/notyping/842.patch | 0 {patches => old-patches}/notyping/843.patch | 0 {patches => old-patches}/notyping/844.patch | 0 {patches => old-patches}/notyping/845.patch | 0 {patches => old-patches}/notyping/848.patch | 0 {patches => old-patches}/notyping/850.patch | 0 {patches => old-patches}/notyping/851.patch | 0 {patches => old-patches}/notyping/853.patch | 0 {patches => old-patches}/notyping/854.patch | 0 {patches => old-patches}/notyping/855.patch | 0 {patches => old-patches}/notyping/856.patch | 0 {patches => old-patches}/notyping/876.patch | 0 {patches => old-patches}/notyping/884.patch | 0 {patches => old-patches}/notyping/888.patch | 0 {patches => old-patches}/notyping/896.patch | 0 {patches => old-patches}/notyping/897.patch | 0 {patches => old-patches}/notyping/898.patch | 0 {patches => old-patches}/notyping/899.patch | 0 {patches => old-patches}/notyping/900.patch | 0 {patches => old-patches}/notyping/901.patch | 0 {patches => old-patches}/notyping/902.patch | 0 {patches => old-patches}/notyping/903.patch | 0 {patches => old-patches}/notyping/README.md | 0 patches/slashcommands/903.patch | 112 ++++++++++++++++++-- patches/slashcommands/README.md | 1 + 28 files changed, 105 insertions(+), 8 deletions(-) rename {patches => old-patches}/notyping/836.patch (100%) rename {patches => old-patches}/notyping/839.patch (100%) rename {patches => old-patches}/notyping/841.patch (100%) rename {patches => old-patches}/notyping/842.patch (100%) rename {patches => old-patches}/notyping/843.patch (100%) rename {patches => old-patches}/notyping/844.patch (100%) rename {patches => old-patches}/notyping/845.patch (100%) rename {patches => old-patches}/notyping/848.patch (100%) rename {patches => old-patches}/notyping/850.patch (100%) rename {patches => old-patches}/notyping/851.patch (100%) rename {patches => old-patches}/notyping/853.patch (100%) rename {patches => old-patches}/notyping/854.patch (100%) rename {patches => old-patches}/notyping/855.patch (100%) rename {patches => old-patches}/notyping/856.patch (100%) rename {patches => old-patches}/notyping/876.patch (100%) rename {patches => old-patches}/notyping/884.patch (100%) rename {patches => old-patches}/notyping/888.patch (100%) rename {patches => old-patches}/notyping/896.patch (100%) rename {patches => old-patches}/notyping/897.patch (100%) rename {patches => old-patches}/notyping/898.patch (100%) rename {patches => old-patches}/notyping/899.patch (100%) rename {patches => old-patches}/notyping/900.patch (100%) rename {patches => old-patches}/notyping/901.patch (100%) rename {patches => old-patches}/notyping/902.patch (100%) rename {patches => old-patches}/notyping/903.patch (100%) rename {patches => old-patches}/notyping/README.md (100%) diff --git a/patches/notyping/836.patch b/old-patches/notyping/836.patch similarity index 100% rename from patches/notyping/836.patch rename to old-patches/notyping/836.patch diff --git a/patches/notyping/839.patch b/old-patches/notyping/839.patch similarity index 100% rename from patches/notyping/839.patch rename to old-patches/notyping/839.patch diff --git a/patches/notyping/841.patch b/old-patches/notyping/841.patch similarity index 100% rename from patches/notyping/841.patch rename to old-patches/notyping/841.patch diff --git a/patches/notyping/842.patch b/old-patches/notyping/842.patch similarity index 100% rename from patches/notyping/842.patch rename to old-patches/notyping/842.patch diff --git a/patches/notyping/843.patch b/old-patches/notyping/843.patch similarity index 100% rename from patches/notyping/843.patch rename to old-patches/notyping/843.patch diff --git a/patches/notyping/844.patch b/old-patches/notyping/844.patch similarity index 100% rename from patches/notyping/844.patch rename to old-patches/notyping/844.patch diff --git a/patches/notyping/845.patch b/old-patches/notyping/845.patch similarity index 100% rename from patches/notyping/845.patch rename to old-patches/notyping/845.patch diff --git a/patches/notyping/848.patch b/old-patches/notyping/848.patch similarity index 100% rename from patches/notyping/848.patch rename to old-patches/notyping/848.patch diff --git a/patches/notyping/850.patch b/old-patches/notyping/850.patch similarity index 100% rename from patches/notyping/850.patch rename to old-patches/notyping/850.patch diff --git a/patches/notyping/851.patch b/old-patches/notyping/851.patch similarity index 100% rename from patches/notyping/851.patch rename to old-patches/notyping/851.patch diff --git a/patches/notyping/853.patch b/old-patches/notyping/853.patch similarity index 100% rename from patches/notyping/853.patch rename to old-patches/notyping/853.patch diff --git a/patches/notyping/854.patch b/old-patches/notyping/854.patch similarity index 100% rename from patches/notyping/854.patch rename to old-patches/notyping/854.patch diff --git a/patches/notyping/855.patch b/old-patches/notyping/855.patch similarity index 100% rename from patches/notyping/855.patch rename to old-patches/notyping/855.patch diff --git a/patches/notyping/856.patch b/old-patches/notyping/856.patch similarity index 100% rename from patches/notyping/856.patch rename to old-patches/notyping/856.patch diff --git a/patches/notyping/876.patch b/old-patches/notyping/876.patch similarity index 100% rename from patches/notyping/876.patch rename to old-patches/notyping/876.patch diff --git a/patches/notyping/884.patch b/old-patches/notyping/884.patch similarity index 100% rename from patches/notyping/884.patch rename to old-patches/notyping/884.patch diff --git a/patches/notyping/888.patch b/old-patches/notyping/888.patch similarity index 100% rename from patches/notyping/888.patch rename to old-patches/notyping/888.patch diff --git a/patches/notyping/896.patch b/old-patches/notyping/896.patch similarity index 100% rename from patches/notyping/896.patch rename to old-patches/notyping/896.patch diff --git a/patches/notyping/897.patch b/old-patches/notyping/897.patch similarity index 100% rename from patches/notyping/897.patch rename to old-patches/notyping/897.patch diff --git a/patches/notyping/898.patch b/old-patches/notyping/898.patch similarity index 100% rename from patches/notyping/898.patch rename to old-patches/notyping/898.patch diff --git a/patches/notyping/899.patch b/old-patches/notyping/899.patch similarity index 100% rename from patches/notyping/899.patch rename to old-patches/notyping/899.patch diff --git a/patches/notyping/900.patch b/old-patches/notyping/900.patch similarity index 100% rename from patches/notyping/900.patch rename to old-patches/notyping/900.patch diff --git a/patches/notyping/901.patch b/old-patches/notyping/901.patch similarity index 100% rename from patches/notyping/901.patch rename to old-patches/notyping/901.patch diff --git a/patches/notyping/902.patch b/old-patches/notyping/902.patch similarity index 100% rename from patches/notyping/902.patch rename to old-patches/notyping/902.patch diff --git a/patches/notyping/903.patch b/old-patches/notyping/903.patch similarity index 100% rename from patches/notyping/903.patch rename to old-patches/notyping/903.patch diff --git a/patches/notyping/README.md b/old-patches/notyping/README.md similarity index 100% rename from patches/notyping/README.md rename to old-patches/notyping/README.md diff --git a/patches/slashcommands/903.patch b/patches/slashcommands/903.patch index 99cbc642..a18c9d98 100644 --- a/patches/slashcommands/903.patch +++ b/patches/slashcommands/903.patch @@ -2,7 +2,7 @@ Only in com.discord-903: build Only in com.discord-903: dist diff -crB com.discord-903-base/smali/com/discord/models/domain/ModelChannel.smali com.discord-903/smali/com/discord/models/domain/ModelChannel.smali *** com.discord-903-base/smali/com/discord/models/domain/ModelChannel.smali 2019-05-24 23:40:49.520802264 +0300 ---- com.discord-903/smali/com/discord/models/domain/ModelChannel.smali 2019-05-25 05:00:46.074702303 +0300 +--- com.discord-903/smali/com/discord/models/domain/ModelChannel.smali 2019-05-26 16:28:14.734931852 +0300 *************** *** 2082,2087 **** --- 2082,2097 ---- @@ -24,7 +24,7 @@ diff -crB com.discord-903-base/smali/com/discord/models/domain/ModelChannel.smal diff -crB com.discord-903-base/smali/com/discord/stores/StoreMessages.smali com.discord-903/smali/com/discord/stores/StoreMessages.smali *** com.discord-903-base/smali/com/discord/stores/StoreMessages.smali 2019-05-24 23:40:49.670802999 +0300 ---- com.discord-903/smali/com/discord/stores/StoreMessages.smali 2019-05-25 05:39:51.367962305 +0300 +--- com.discord-903/smali/com/discord/stores/StoreMessages.smali 2019-05-26 16:39:58.879207449 +0300 *************** *** 432,437 **** --- 432,441 ---- @@ -40,7 +40,7 @@ diff -crB com.discord-903-base/smali/com/discord/stores/StoreMessages.smali com. *************** *** 948,953 **** ---- 952,3537 ---- +--- 952,3574 ---- return-void .end method @@ -2241,7 +2241,7 @@ diff -crB com.discord-903-base/smali/com/discord/stores/StoreMessages.smali com. + + move-result v0 + -+ if-eqz v0, :cond_1 ++ if-eqz v0, :cond_2 + + # Move to config value interpretation + @@ -2269,6 +2269,43 @@ diff -crB com.discord-903-base/smali/com/discord/stores/StoreMessages.smali com. + + return-object p0 + ++ # Move to second secondary command's interpretation ++ ++ :cond_2 ++ const-string v0, "showtyping " ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v0 ++ ++ if-eqz v0, :cond_1 ++ ++ # Move to config value interpretation ++ ++ const/16 v0, 0xb ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String; ++ ++ move-result-object p0 ++ ++ const-string v0, "true" ++ ++ invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z ++ ++ move-result v1 ++ ++ # Set value ++ ++ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings; ++ ++ move-result-object v0 ++ ++ invoke-virtual {v0, v1}, Lcom/discord/stores/StoreUserSettings;->setShowTyping(Z)V ++ ++ const-string p0, "CTC: Set showtyping state. (Under ideal conditions this should only be visible to you, but the world isn't always that fair, is it now?)" ++ ++ return-object p0 ++ + :cond_1 + const-string p0, "CTC: No known command supplied. (Under ideal conditions this should only be visible to you, but the world isn't always that fair, is it now?)" + @@ -2629,7 +2666,7 @@ diff -crB com.discord-903-base/smali/com/discord/stores/StoreMessages.smali com. .annotation system Ldalvik/annotation/Signature; *************** *** 977,982 **** ---- 3561,3570 ---- +--- 3598,3607 ---- invoke-static {p4, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V @@ -2640,13 +2677,12 @@ diff -crB com.discord-903-base/smali/com/discord/stores/StoreMessages.smali com. const/4 v0, 0x1 if-eqz p6, :cond_0 -Only in com.discord-903/smali/com/discord/stores: StoreMessages.smali.orig diff -crB com.discord-903-base/smali/com/discord/stores/StoreUserSettings.smali com.discord-903/smali/com/discord/stores/StoreUserSettings.smali *** com.discord-903-base/smali/com/discord/stores/StoreUserSettings.smali 2019-05-24 23:40:49.700803146 +0300 ---- com.discord-903/smali/com/discord/stores/StoreUserSettings.smali 2019-05-25 04:41:00.951108339 +0300 +--- com.discord-903/smali/com/discord/stores/StoreUserSettings.smali 2019-05-26 16:28:45.931787947 +0300 *************** *** 1272,1277 **** ---- 1272,1315 ---- +--- 1272,1353 ---- return v0 .end method @@ -2687,7 +2723,67 @@ diff -crB com.discord-903-base/smali/com/discord/stores/StoreUserSettings.smali + + return-void + .end method ++ ++ .method public getShowTyping()Z ++ .locals 3 ++ ++ .line 179 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; ++ ++ const-string v1, "CACHE_KEY_CTC_SHOW_TYPING" ++ ++ const/4 v2, 0x1 ++ ++ invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z ++ ++ move-result v0 ++ ++ return v0 ++ .end method ++ ++ .method public setShowTyping(Z)V ++ .locals 2 ++ ++ .line 331 ++ iget-object v0, p0, Lcom/discord/stores/StoreUserSettings;->prefs:Landroid/content/SharedPreferences; ++ ++ invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; ++ ++ move-result-object v0 ++ ++ const-string v1, "CACHE_KEY_CTC_SHOW_TYPING" ++ ++ invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor; ++ ++ move-result-object p1 ++ ++ invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V ++ ++ return-void ++ .end method + .method handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V .locals 0 +diff -crB com.discord-903-base/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali com.discord-903/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali +*** com.discord-903-base/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2019-05-24 23:40:49.907470826 +0300 +--- com.discord-903/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2019-05-26 16:32:19.513084840 +0300 +*************** +*** 124,129 **** +--- 124,139 ---- + + invoke-static {p1, v0, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputEditText;->access$202(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;J)J + ++ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings; ++ ++ move-result-object p1 ++ ++ invoke-virtual {p1}, Lcom/discord/stores/StoreUserSettings;->getShowTyping()Z ++ ++ move-result p1 ++ ++ if-eqz p1, :cond_1 ++ + .line 222 + invoke-static {}, Lcom/discord/stores/StoreStream;->getUsersTyping()Lcom/discord/stores/StoreUserTyping; + diff --git a/patches/slashcommands/README.md b/patches/slashcommands/README.md index e6850969..42faac02 100644 --- a/patches/slashcommands/README.md +++ b/patches/slashcommands/README.md @@ -24,6 +24,7 @@ Following commands are supported, but create less accessible text (so you should CutTheCord has a couple features that can be enabled or disabled with slash commands as well: - /ctc channelleak true/false -> Shows all channels, even those you don't have permissions to view (might mess with channel editing or editing while it's enabled) +- /ctc notyping true/false -> Disables typing event so that it's not visible when you type Commands like fw can be generated by `textreplacegen.py` or `textreplacegen-array.py` provided in this folder.