port to 1282

This commit is contained in:
Juby210 2020-09-30 16:26:24 +02:00
parent 87ccecb164
commit 8c59ea447d

View file

@ -1,27 +1,117 @@
diff -crB from/smali/com/discord/gateway/io/IncomingParser.smali to/smali/com/discord/gateway/io/IncomingParser.smali
*** from/smali/com/discord/gateway/io/IncomingParser.smali 2020-09-23 12:13:30.856701806 +0100
--- to/smali/com/discord/gateway/io/IncomingParser.smali 2020-09-23 12:14:23.748688577 +0100
diff -crBN from/smali/com/cutthecord/Utils.smali to/smali/com/cutthecord/Utils.smali
*** from/smali/com/cutthecord/Utils.smali Thu Jan 1 01:00:00 1970
--- to/smali/com/cutthecord/Utils.smali Thu Aug 13 14:15:11 2020
***************
*** 754,759 ****
--- 754,770 ----
.line 57
:goto_2
*** 0 ****
--- 1,36 ----
+ .class public Lcom/cutthecord/Utils;
+ .super Ljava/lang/Object;
+
+ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings;
+
+ move-result-object v0
+ # static fields
+ .field public static messageFragment:Landroidx/fragment/app/Fragment;
+
+ invoke-virtual {v0}, Lcom/discord/stores/StoreUserSettings;->getNoDelete()Z
+
+ move-result v4
+ # direct methods
+ .method public constructor <init>()V
+ .locals 0
+
+ if-nez v4, :cond_b
+ invoke-direct {p0}, Ljava/lang/Object;-><init>()V
+
new-instance v0, Lcom/discord/models/domain/ModelMessageDelete;
invoke-direct {v0}, Lcom/discord/models/domain/ModelMessageDelete;-><init>()V
diff -crB from/smali/com/discord/models/domain/ModelChannel.smali to/smali/com/discord/models/domain/ModelChannel.smali
+ return-void
+ .end method
+
+ .method public static refreshView()V
+ .locals 2
+
+ new-instance v0, Landroid/os/Handler;
+
+ invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
+
+ move-result-object v1
+
+ invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
+
+ new-instance v1, Lcom/cutthecord/refreshView;
+
+ invoke-direct {v1}, Lcom/cutthecord/refreshView;-><init>()V
+
+ invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
+
+ return-void
+ .end method
diff -crBN from/smali/com/cutthecord/refreshView.smali to/smali/com/cutthecord/refreshView.smali
*** from/smali/com/cutthecord/refreshView.smali Thu Jan 1 01:00:00 1970
--- to/smali/com/cutthecord/refreshView.smali Thu Aug 13 13:56:59 2020
***************
*** 0 ****
--- 1,65 ----
+ .class final Lcom/cutthecord/refreshView;
+ .super Ljava/lang/Object;
+
+ # interfaces
+ .implements Ljava/lang/Runnable;
+
+
+ # direct methods
+ .method public constructor <init>()V
+ .locals 0
+
+ invoke-direct {p0}, Ljava/lang/Object;-><init>()V
+
+ return-void
+ .end method
+
+
+ # virtual methods
+ .method public run()V
+ .locals 4
+
+ sget-object v0, Lcom/cutthecord/Utils;->messageFragment:Landroidx/fragment/app/Fragment;
+
+ if-eqz v0, :cond_0
+
+ invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->isStateSaved()Z
+
+ move-result v1
+
+ if-nez v1, :cond_0
+
+ invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->getFragmentManager()Landroidx/fragment/app/FragmentManager;
+
+ move-result-object v1
+
+ if-eqz v1, :cond_0
+
+ invoke-virtual {v1}, Landroidx/fragment/app/FragmentManager;->beginTransaction()Landroidx/fragment/app/FragmentTransaction;
+
+ move-result-object v1
+
+ sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
+
+ const/16 v3, 0x1a # 26
+
+ if-lt v2, v3, :cond_1
+
+ const/4 v2, 0x0
+
+ invoke-virtual {v1, v2}, Landroidx/fragment/app/FragmentTransaction;->setReorderingAllowed(Z)Landroidx/fragment/app/FragmentTransaction;
+
+ :cond_1
+ invoke-virtual {v1, v0}, Landroidx/fragment/app/FragmentTransaction;->detach(Landroidx/fragment/app/Fragment;)Landroidx/fragment/app/FragmentTransaction;
+
+ move-result-object v1
+
+ invoke-virtual {v1, v0}, Landroidx/fragment/app/FragmentTransaction;->attach(Landroidx/fragment/app/Fragment;)Landroidx/fragment/app/FragmentTransaction;
+
+ move-result-object v1
+
+ invoke-virtual {v1}, Landroidx/fragment/app/FragmentTransaction;->commit()I
+
+ :cond_0
+ return-void
+ .end method
diff -crBN from/smali/com/discord/models/domain/ModelChannel.smali to/smali/com/discord/models/domain/ModelChannel.smali
*** from/smali/com/discord/models/domain/ModelChannel.smali 2020-09-23 12:13:30.866701806 +0100
--- to/smali/com/discord/models/domain/ModelChannel.smali 2020-09-23 12:14:23.750688576 +0100
***************
@ -43,7 +133,35 @@ diff -crB from/smali/com/discord/models/domain/ModelChannel.smali to/smali/com/d
.line 1
iget-object v0, p0, Lcom/discord/models/domain/ModelChannel;->permissionOverwrites:Ljava/util/Map;
diff -crB from/smali/com/discord/models/domain/ModelMessageEmbed.smali to/smali/com/discord/models/domain/ModelMessageEmbed.smali
diff -crBN from/smali/com/discord/models/domain/ModelMessage.smali to/smali/com/discord/models/domain/ModelMessage.smali
*** from/smali/com/discord/models/domain/ModelMessage.smali Wed Aug 12 18:07:38 2020
--- to/smali/com/discord/models/domain/ModelMessage.smali Thu Aug 13 12:03:45 2020
***************
*** 155,160 ****
--- 155,162 ----
.field public content:Ljava/lang/String;
+ .field public deleted:Z
+
.field public editedTimestamp:Ljava/lang/String;
.field public transient editedTimestampMilliseconds:Ljava/lang/Long;
***************
*** 311,316 ****
--- 313,322 ----
sget-object v0, Lcom/discord/models/domain/ModelUser;->EMPTY:Lcom/discord/models/domain/ModelUser;
iput-object v0, p0, Lcom/discord/models/domain/ModelMessage;->author:Lcom/discord/models/domain/ModelUser;
+
+ const/4 v0, 0x0
+
+ iput-boolean v0, p0, Lcom/discord/models/domain/ModelMessage;->deleted:Z
return-void
.end method
diff -crBN from/smali/com/discord/models/domain/ModelMessageEmbed.smali to/smali/com/discord/models/domain/ModelMessageEmbed.smali
*** from/smali/com/discord/models/domain/ModelMessageEmbed.smali 2020-09-23 12:13:30.880701802 +0100
--- to/smali/com/discord/models/domain/ModelMessageEmbed.smali 2020-09-23 12:14:23.750688576 +0100
***************
@ -103,7 +221,89 @@ diff -crB from/smali/com/discord/models/domain/ModelMessageEmbed.smali to/smali/
.end method
.method public toString()Ljava/lang/String;
diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/discord/stores/StoreUserSettings.smali
diff -crBN from/smali/com/discord/stores/StoreMessagesHolder.smali to/smali/com/discord/stores/StoreMessagesHolder.smali
*** from/smali/com/discord/stores/StoreMessagesHolder.smali Wed Aug 12 18:07:38 2020
--- to/smali/com/discord/stores/StoreMessagesHolder.smali Thu Aug 13 15:01:22 2020
***************
*** 1395,1401 ****
.end method
.method public deleteMessages(JLjava/util/List;)V
! .locals 5
.param p3 # Ljava/util/List;
.annotation build Landroidx/annotation/Nullable;
.end annotation
--- 1395,1401 ----
.end method
.method public deleteMessages(JLjava/util/List;)V
! .locals 6
.param p3 # Ljava/util/List;
.annotation build Landroidx/annotation/Nullable;
.end annotation
***************
*** 1451,1456 ****
--- 1451,1464 ----
move-result-object p3
+ invoke-static {}, Lcom/discord/stores/StoreStream;->getUserSettings()Lcom/discord/stores/StoreUserSettings;
+
+ move-result-object v5
+
+ invoke-virtual {v5}, Lcom/discord/stores/StoreUserSettings;->getNoDelete()Z
+
+ move-result v5
+
:cond_1
:goto_0
invoke-interface {p3}, Ljava/util/Iterator;->hasNext()Z
***************
*** 1485,1493 ****
--- 1493,1520 ----
move-result-object v2
+ if-nez v5, :cond_4
+
invoke-interface {v1, v2}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;
+ goto :goto_2
+
+ :cond_4
+ invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
+
+ move-result-object v2
+
+ check-cast v2, Lcom/discord/models/domain/ModelMessage;
+
+ if-eqz v2, :cond_5
+
+ const/4 v3, 0x1
+
+ iput-boolean v3, v2, Lcom/discord/models/domain/ModelMessage;->deleted:Z
+
.line 7
+ :goto_2
+ :cond_5
iget-object v2, p0, Lcom/discord/stores/StoreMessagesHolder;->updatedChannels:Ljava/util/Set;
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
***************
*** 1500,1505 ****
--- 1527,1537 ----
.line 8
:cond_2
+ if-eqz v5, :cond_6
+
+ invoke-static {}, Lcom/cutthecord/Utils;->refreshView()V
+
+ :cond_6
invoke-direct {p0}, Lcom/discord/stores/StoreMessagesHolder;->publishIfUpdated()V
.line 9
diff -crBN from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/discord/stores/StoreUserSettings.smali
*** from/smali/com/discord/stores/StoreUserSettings.smali 2020-09-23 12:13:31.036701774 +0100
--- to/smali/com/discord/stores/StoreUserSettings.smali 2020-09-23 12:14:23.750688576 +0100
***************
@ -399,7 +599,7 @@ diff -crB from/smali/com/discord/stores/StoreUserSettings.smali to/smali/com/dis
.method private getAdjustedTheme(Ljava/lang/String;)Ljava/lang/String;
.locals 1
diff -crB from/smali/com/discord/utilities/rest/SendUtils$getPart$1$1.smali to/smali/com/discord/utilities/rest/SendUtils$getPart$1$1.smali
diff -crBN from/smali/com/discord/utilities/rest/SendUtils$getPart$1$1.smali to/smali/com/discord/utilities/rest/SendUtils$getPart$1$1.smali
*** from/smali/com/discord/utilities/rest/SendUtils$getPart$1$1.smali 2020-09-23 12:13:31.148701754 +0100
--- to/smali/com/discord/utilities/rest/SendUtils$getPart$1$1.smali 2020-09-23 12:14:23.750688576 +0100
***************
@ -458,7 +658,7 @@ diff -crB from/smali/com/discord/utilities/rest/SendUtils$getPart$1$1.smali to/s
.line 4
iget-object p1, p0, Lcom/discord/utilities/rest/SendUtils$getPart$1$1;->this$0:Lcom/discord/utilities/rest/SendUtils$getPart$1;
diff -crB from/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali to/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali
diff -crBN from/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali to/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali
*** from/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2020-09-23 12:13:31.270701732 +0100
--- to/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.smali 2020-09-23 12:14:23.750688576 +0100
***************
@ -480,7 +680,7 @@ diff -crB from/smali/com/discord/widgets/chat/input/WidgetChatInputEditText$1.sm
.line 4
iget-boolean v0, p0, Lcom/discord/widgets/chat/input/WidgetChatInputEditText$1;->empty:Z
diff -crB from/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali to/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali
diff -crBN from/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali to/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali
*** from/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali 2020-09-23 12:13:31.272701730 +0100
--- to/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali 2020-09-23 12:14:23.750688576 +0100
***************
@ -519,7 +719,7 @@ diff -crB from/smali/com/discord/widgets/chat/input/WidgetChatInputSend.smali to
.method private final clearInput(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;Lcom/lytefast/flexinput/viewmodel/FlexInputViewModel;Ljava/lang/Boolean;)Z
.locals 1
diff -crB from/smali/com/discord/widgets/chat/list/InlineMediaView.smali to/smali/com/discord/widgets/chat/list/InlineMediaView.smali
diff -crBN from/smali/com/discord/widgets/chat/list/InlineMediaView.smali to/smali/com/discord/widgets/chat/list/InlineMediaView.smali
*** from/smali/com/discord/widgets/chat/list/InlineMediaView.smali 2020-09-23 12:13:31.298701725 +0100
--- to/smali/com/discord/widgets/chat/list/InlineMediaView.smali 2020-09-23 12:14:23.750688576 +0100
***************
@ -541,3 +741,88 @@ diff -crB from/smali/com/discord/widgets/chat/list/InlineMediaView.smali to/smal
if-eqz v1, :cond_6
const/4 v7, 0x1
diff -crBN from/smali/com/discord/widgets/chat/list/WidgetChatList.smali to/smali/com/discord/widgets/chat/list/WidgetChatList.smali
*** from/smali/com/discord/widgets/chat/list/WidgetChatList.smali Wed Aug 12 18:07:40 2020
--- to/smali/com/discord/widgets/chat/list/WidgetChatList.smali Thu Aug 13 13:58:01 2020
***************
*** 40,45 ****
--- 40,47 ----
.line 3
iput-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatList;->_flexInputViewModel:Lcom/discord/widgets/chat/input/AppFlexInputViewModel;
+ sput-object p0, Lcom/cutthecord/Utils;->messageFragment:Landroidx/fragment/app/Fragment;
+
return-void
.end method
diff -crBN from/smali/com/discord/widgets/chat/list/WidgetChatListAdapterItemMessage.smali to/smali/com/discord/widgets/chat/list/WidgetChatListAdapterItemMessage.smali
*** from/smali/com/discord/widgets/chat/list/WidgetChatListAdapterItemMessage.smali Wed Aug 12 18:07:40 2020
--- to/smali/com/discord/widgets/chat/list/WidgetChatListAdapterItemMessage.smali Thu Aug 13 12:19:34 2020
***************
*** 1271,1276 ****
--- 1271,1335 ----
.line 21
:cond_3
+ iget-boolean v2, v14, Lcom/discord/models/domain/ModelMessage;->deleted:Z
+
+ if-eqz v2, :cond_d
+
+ new-instance v2, Ljava/util/ArrayList;
+
+ const/4 v3, 0x2
+
+ invoke-direct {v2, v3}, Ljava/util/ArrayList;-><init>(I)V
+
+ .line 14
+ new-instance v3, Landroid/text/style/RelativeSizeSpan;
+
+ const/high16 v4, 0x3f400000 # 0.75f
+
+ invoke-direct {v3, v4}, Landroid/text/style/RelativeSizeSpan;-><init>(F)V
+
+ invoke-virtual {v2, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
+
+ .line 15
+ new-instance v3, Landroid/text/style/ForegroundColorSpan;
+
+ const v4, 0x7f040177
+
+ invoke-static {v15, v4}, Lcom/discord/utilities/color/ColorCompat;->getThemedColor(Landroid/content/Context;I)I
+
+ move-result v4
+
+ invoke-direct {v3, v4}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
+
+ invoke-virtual {v2, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
+
+ .line 16
+ new-instance v3, Lf/a/j/a/a/a;
+
+ const-string v4, " "
+
+ invoke-direct {v3, v4}, Lf/a/j/a/a/a;-><init>(Ljava/lang/String;)V
+
+ invoke-interface {v13, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
+
+ .line 17
+ new-instance v3, Lcom/discord/simpleast/core/node/StyleNode;
+
+ invoke-direct {v3, v2}, Lcom/discord/simpleast/core/node/StyleNode;-><init>(Ljava/util/List;)V
+
+ .line 18
+ new-instance v2, Lf/a/j/a/a/a;
+
+ const-string v4, "(deleted)"
+
+ invoke-direct {v2, v4}, Lf/a/j/a/a/a;-><init>(Ljava/lang/String;)V
+
+ invoke-virtual {v3, v2}, Lcom/discord/simpleast/core/node/Node;->addChild(Lcom/discord/simpleast/core/node/Node;)V
+
+ .line 19
+ invoke-interface {v13, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
+
+ :cond_d
invoke-virtual {v12}, Lcom/discord/utilities/textprocessing/MessagePreprocessor;->isLinkifyConflicting()Z
move-result v2