From e25838159802ecb56491bdfe4a1ef62b89fee4de Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Sun, 17 May 2020 18:57:31 +0300 Subject: [PATCH] New patch: profilemention --- patches/README.md | 3 +- patches/profilemention/1144.patch | 68 +++++++++++++++++++++++++++++++ patches/profilemention/README.md | 7 ++++ 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 patches/profilemention/1144.patch create mode 100644 patches/profilemention/README.md diff --git a/patches/README.md b/patches/README.md index 2252f1e..f896285 100644 --- a/patches/README.md +++ b/patches/README.md @@ -71,8 +71,7 @@ Video demonstration: https://www.youtube.com/watch?v=NMRPsAgqtWQ - nospoiler: Automatically shows all spoilers. Useful for moderation. - **notrack**: Disables most of the tracking in Discord. Included in all official branches. - nozlib: Disables zlib-stream field on wss, making it easier to parse wss communications when MITMing the app. - -![Pure evil setting](https://elixi.re/i/f1e7t1y0.png) +- profilemention: Restores the behavior where tapping a user's profile picture adds their mention to the chat box instead of opening their profile. - **supplemental**: Adds some helper functions needed by certain patches. diff --git a/patches/profilemention/1144.patch b/patches/profilemention/1144.patch new file mode 100644 index 0000000..f1d93df --- /dev/null +++ b/patches/profilemention/1144.patch @@ -0,0 +1,68 @@ +Binary files com.discord-1144-base/build/apk/classes.dex and com.discord-1144/build/apk/classes.dex differ +Binary files com.discord-1144-base/dist/com.discord-1144.apk and com.discord-1144/dist/com.discord-1144.apk differ +diff -crB com.discord-1144-base/smali/com/discord/widgets/chat/list/WidgetChatList$1.smali com.discord-1144/smali/com/discord/widgets/chat/list/WidgetChatList$1.smali +*** com.discord-1144-base/smali/com/discord/widgets/chat/list/WidgetChatList$1.smali 2020-05-17 16:38:27.721935754 +0300 +--- com.discord-1144/smali/com/discord/widgets/chat/list/WidgetChatList$1.smali 2020-05-17 18:54:27.266627013 +0300 +*************** +*** 230,288 **** + .end annotation + .end param + +- .line 1 +- invoke-static {p1}, Lcom/discord/utilities/guilds/PublicGuildUtils;->isPublicGuildSystemMessage(Lcom/discord/models/domain/ModelMessage;)Z +- +- move-result v0 +- +- if-nez v0, :cond_1 +- +- invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getMessageReference()Lcom/discord/models/domain/ModelMessage$MessageReference; +- +- move-result-object v0 +- +- if-eqz v0, :cond_0 +- +- goto :goto_0 +- +- .line 2 +- :cond_0 +- invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser; +- +- move-result-object v0 +- +- invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J +- +- move-result-wide v0 +- +- invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J +- +- move-result-wide v2 +- +- invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; +- +- move-result-object p1 +- +- iget-object v2, p0, Lcom/discord/widgets/chat/list/WidgetChatList$1;->this$0:Lcom/discord/widgets/chat/list/WidgetChatList; +- +- invoke-virtual {v2}, Landroidx/fragment/app/Fragment;->getFragmentManager()Landroidx/fragment/app/FragmentManager; +- +- move-result-object v2 +- +- invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; +- +- move-result-object p2 +- +- invoke-static {v0, v1, p1, v2, p2}, Lcom/discord/widgets/user/usersheet/WidgetUserSheet;->show(JLjava/lang/Long;Landroidx/fragment/app/FragmentManager;Ljava/lang/Long;)V +- +- goto :goto_1 +- +- .line 3 +- :cond_1 +- :goto_0 + invoke-virtual {p0, p1, p2, p3}, Lcom/discord/widgets/chat/list/WidgetChatList$1;->onMessageAuthorNameClicked(Lcom/discord/models/domain/ModelMessage;J)V + +- :goto_1 + return-void + .end method + +--- 230,237 ---- + diff --git a/patches/profilemention/README.md b/patches/profilemention/README.md new file mode 100644 index 0000000..73db871 --- /dev/null +++ b/patches/profilemention/README.md @@ -0,0 +1,7 @@ +## DisTok CutTheCord: Profile Mention Patch + +This patch restores the behavior where tapping a user's profile picture adds their mention to the chat box instead of opening their profile. + +#### Available and tested on: +- 22.4 +