profilemention 89207

This commit is contained in:
46620 2021-08-21 10:15:23 +00:00
parent d2f5e9d10b
commit d9137a0345
3 changed files with 168 additions and 0 deletions

View file

@ -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 ----

View file

@ -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

View file

@ -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