From d9137a03456ebf47c539f228da7929d6c322a285 Mon Sep 17 00:00:00 2001 From: 46620 <46620osu@gmail.com> Date: Sat, 21 Aug 2021 10:15:23 +0000 Subject: [PATCH] profilemention 89207 --- patches/profilemention/1371.patch | 65 ++++++++++++++++++++ patches/profilemention/89207.patch | 96 ++++++++++++++++++++++++++++++ patches/profilemention/README.md | 7 +++ 3 files changed, 168 insertions(+) create mode 100644 patches/profilemention/1371.patch create mode 100644 patches/profilemention/89207.patch create mode 100644 patches/profilemention/README.md diff --git a/patches/profilemention/1371.patch b/patches/profilemention/1371.patch new file mode 100644 index 0000000..e1e4006 --- /dev/null +++ b/patches/profilemention/1371.patch @@ -0,0 +1,65 @@ +diff -crB from/smali/com/discord/widgets/chat/list/WidgetChatList$1.smali to/smali/com/discord/widgets/chat/list/WidgetChatList$1.smali +*** from/smali/com/discord/widgets/chat/list/WidgetChatList$1.smali 2020-11-16 13:22:49.739198178 +0000 +--- to/smali/com/discord/widgets/chat/list/WidgetChatList$1.smali 2020-11-16 13:37:00.453313204 +0000 +*************** +*** 133,191 **** + .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;->isCrosspost()Z +- +- move-result 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;->getParentFragmentManager()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 + +--- 133,140 ---- \ No newline at end of file diff --git a/patches/profilemention/89207.patch b/patches/profilemention/89207.patch new file mode 100644 index 0000000..e83d22c --- /dev/null +++ b/patches/profilemention/89207.patch @@ -0,0 +1,96 @@ +*** discord/com.discord/smali_classes2/com/discord/widgets/chat/list/adapter/WidgetChatListAdapterEventsHandler.smali 2021-08-21 10:13:37.752083749 +0000 +--- com.discord/smali_classes2/com/discord/widgets/chat/list/adapter/WidgetChatListAdapterEventsHandler.smali 2021-08-21 10:11:39.864132196 +0000 +*************** +*** 747,827 **** + .end method + + .method public onMessageAuthorAvatarClicked(Lcom/discord/models/message/Message;J)V +! .locals 12 + +- const-string v0, "message" +- +- invoke-static {p1, v0}, Ld0/z/d/m;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V +- +- .line 1 +- sget-object v0, Lcom/discord/utilities/guilds/PublicGuildUtils;->INSTANCE:Lcom/discord/utilities/guilds/PublicGuildUtils; +- +- invoke-virtual {v0, p1}, Lcom/discord/utilities/guilds/PublicGuildUtils;->isPublicGuildSystemMessage(Lcom/discord/models/message/Message;)Z +- +- move-result v0 +- +- if-nez v0, :cond_1 +- +- invoke-virtual {p1}, Lcom/discord/models/message/Message;->isCrosspost()Z +- +- move-result v0 +- +- if-eqz v0, :cond_0 +- +- goto :goto_0 +- +- .line 2 +- :cond_0 +- invoke-virtual {p1}, Lcom/discord/models/message/Message;->getAuthor()Lcom/discord/api/user/User; +- +- move-result-object v0 +- +- if-eqz v0, :cond_2 +- +- .line 3 +- sget-object v1, Lcom/discord/widgets/user/usersheet/WidgetUserSheet;->Companion:Lcom/discord/widgets/user/usersheet/WidgetUserSheet$Companion; +- +- invoke-virtual {v0}, Lcom/discord/api/user/User;->i()J +- +- move-result-wide v2 +- +- invoke-virtual {p1}, Lcom/discord/models/message/Message;->getChannelId()J +- +- move-result-wide v4 +- +- invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; +- +- move-result-object v4 +- +- invoke-direct {p0}, Lcom/discord/widgets/chat/list/adapter/WidgetChatListAdapterEventsHandler;->getFragmentManager()Landroidx/fragment/app/FragmentManager; +- +- move-result-object v5 +- +- invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; +- +- move-result-object v6 +- +- const/4 v7, 0x0 +- +- const/4 v8, 0x0 +- +- const/4 v9, 0x0 +- +- const/16 v10, 0x70 +- +- const/4 v11, 0x0 +- +- invoke-static/range {v1 .. v11}, Lcom/discord/widgets/user/usersheet/WidgetUserSheet$Companion;->show$default(Lcom/discord/widgets/user/usersheet/WidgetUserSheet$Companion;JLjava/lang/Long;Landroidx/fragment/app/FragmentManager;Ljava/lang/Long;Ljava/lang/Boolean;Lcom/discord/widgets/user/usersheet/WidgetUserSheet$StreamPreviewClickBehavior;Ljava/lang/String;ILjava/lang/Object;)V +- +- goto :goto_1 +- +- .line 4 +- :cond_1 +- :goto_0 + invoke-virtual {p0, p1, p2, p3}, Lcom/discord/widgets/chat/list/adapter/WidgetChatListAdapterEventsHandler;->onMessageAuthorNameClicked(Lcom/discord/models/message/Message;J)V + +- :cond_2 +- :goto_1 + return-void + .end method + +--- 747,756 ---- + .end method + + .method public onMessageAuthorAvatarClicked(Lcom/discord/models/message/Message;J)V +! .locals 4 + + invoke-virtual {p0, p1, p2, p3}, Lcom/discord/widgets/chat/list/adapter/WidgetChatListAdapterEventsHandler;->onMessageAuthorNameClicked(Lcom/discord/models/message/Message;J)V + + return-void + .end method + diff --git a/patches/profilemention/README.md b/patches/profilemention/README.md new file mode 100644 index 0000000..2c01ba3 --- /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: +- 56.0 +- 89.7 - Alpha \ No newline at end of file