From 0e3a45de244663e58b22e7f8460d94c578f9fa73 Mon Sep 17 00:00:00 2001 From: Juby210 Date: Tue, 16 Nov 2021 01:10:31 +0100 Subject: [PATCH] 102.8 - Beta (102108) --- app/build.gradle | 4 ++-- app/src/main/AndroidManifest.xml | 2 +- .../com/discord/rtcconnection/RtcConnection.java | 9 +++++---- .../java/com/discord/stores/StoreChannels.java | 14 ++++++++++++++ .../channel/ChannelSelector$findAndSet$1.java | 6 +++--- ...ppFlexInputViewModel$onGiftButtonClicked$1.java | 4 ++-- .../chat/input/sticker/StickerPickerViewModel.java | 8 ++++---- .../chat/pins/WidgetChannelPinnedMessages.java | 6 +++--- .../widgets/guilds/join/ChannelViewHolder.java | 6 +++--- .../discord/widgets/settings/WidgetSettings.java | 2 +- .../widgets/stickers/WidgetStickerSheet.java | 6 +++--- app/src/main/res/values/strings.xml | 2 +- 12 files changed, 42 insertions(+), 27 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6ee31b64be..c496d99780 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId 'com.discord' minSdkVersion 21 targetSdkVersion 30 - versionCode 102107 - versionName "102.7 - Beta" + versionCode 102108 + versionName "102.8 - Beta" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 830a644d0f..e42ac2f8df 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/java/com/discord/rtcconnection/RtcConnection.java b/app/src/main/java/com/discord/rtcconnection/RtcConnection.java index 0fb3cd6ce5..2b74274f7a 100644 --- a/app/src/main/java/com/discord/rtcconnection/RtcConnection.java +++ b/app/src/main/java/com/discord/rtcconnection/RtcConnection.java @@ -41,6 +41,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.concurrent.CopyOnWriteArrayList; import kotlin.NoWhenBranchMatchedException; import kotlin.Unit; import kotlin.jvm.functions.Function0; @@ -89,7 +90,7 @@ public final class RtcConnection implements DebugPrintable, MediaSinkWantsManage public final String f2194c0; public final String k; public final String l; - public final List m; + public final CopyOnWriteArrayList m; public c.a.q.o0.d n; public boolean o; public final Backoff p; @@ -539,8 +540,8 @@ public final class RtcConnection implements DebugPrintable, MediaSinkWantsManage String uuid = UUID.randomUUID().toString(); m.checkNotNullExpressionValue(uuid, "UUID.randomUUID().toString()"); this.l = uuid; - ArrayList arrayList = new ArrayList(); - this.m = arrayList; + CopyOnWriteArrayList copyOnWriteArrayList = new CopyOnWriteArrayList<>(); + this.m = copyOnWriteArrayList; this.p = new Backoff(1000, 10000, 0, false, null, 28, null); StateChange stateChange = new StateChange(new State.d(false), null); this.r = stateChange; @@ -566,7 +567,7 @@ public final class RtcConnection implements DebugPrintable, MediaSinkWantsManage this.H = subscription; r("Created RtcConnection. GuildID: " + l + " ChannelID: " + j2); networkMonitor.observeIsConnected().S(1).W(new p(this), new q(this)); - arrayList.add(new r(this)); + copyOnWriteArrayList.add(new r(this)); this.L = new h0(this); this.M = new b0(this); } diff --git a/app/src/main/java/com/discord/stores/StoreChannels.java b/app/src/main/java/com/discord/stores/StoreChannels.java index a7c74e4d41..ab0df58e2b 100644 --- a/app/src/main/java/com/discord/stores/StoreChannels.java +++ b/app/src/main/java/com/discord/stores/StoreChannels.java @@ -160,6 +160,20 @@ public final class StoreChannels extends StoreV2 { } } + public final Channel findChannelById(long j) { + if (this.threadsByIdSnapshot.containsKey(Long.valueOf(j))) { + return this.threadsByIdSnapshot.get(Long.valueOf(j)); + } + Iterator it = this.channelsByGuildSnapshot.values().iterator(); + while (it.hasNext()) { + Map map = (Map) it.next(); + if (map.containsKey(Long.valueOf(j))) { + return (Channel) map.get(Long.valueOf(j)); + } + } + return null; + } + @StoreThread public final Channel findChannelByIdInternal$app_productionBetaRelease(long j) { if (this.threadsById.containsKey(Long.valueOf(j))) { diff --git a/app/src/main/java/com/discord/utilities/channel/ChannelSelector$findAndSet$1.java b/app/src/main/java/com/discord/utilities/channel/ChannelSelector$findAndSet$1.java index caa338b803..0626d8a2bb 100644 --- a/app/src/main/java/com/discord/utilities/channel/ChannelSelector$findAndSet$1.java +++ b/app/src/main/java/com/discord/utilities/channel/ChannelSelector$findAndSet$1.java @@ -25,9 +25,9 @@ public final class ChannelSelector$findAndSet$1 extends o implements Function0 { public final boolean onStickerSelected(Sticker sticker) { long id2; - Channel findChannelByIdInternal$app_productionBetaRelease; + Channel findChannelById; m.checkNotNullParameter(sticker, "sticker"); - if ((getViewState() instanceof ViewState.Stickers) && (findChannelByIdInternal$app_productionBetaRelease = this.channelStore.findChannelByIdInternal$app_productionBetaRelease((id2 = this.channelSelectedStore.getId()))) != null) { + if ((getViewState() instanceof ViewState.Stickers) && (findChannelById = this.channelStore.findChannelById((id2 = this.channelSelectedStore.getId()))) != null) { Long l = this.permissionStore.getPermissionsByChannel().get(Long.valueOf(id2)); - boolean hasAccessWrite = PermissionUtils.INSTANCE.hasAccessWrite(findChannelByIdInternal$app_productionBetaRelease, l); - StickerUtils.StickerSendability stickerSendability = StickerUtils.INSTANCE.getStickerSendability(sticker, this.userStore.getMe(), findChannelByIdInternal$app_productionBetaRelease, l); + boolean hasAccessWrite = PermissionUtils.INSTANCE.hasAccessWrite(findChannelById, l); + StickerUtils.StickerSendability stickerSendability = StickerUtils.INSTANCE.getStickerSendability(sticker, this.userStore.getMe(), findChannelById, l); if (stickerSendability == StickerUtils.StickerSendability.SENDABLE_WITH_PREMIUM) { this.eventSubject.j.onNext(Event.ShowStickerPremiumUpsell.INSTANCE); return false; diff --git a/app/src/main/java/com/discord/widgets/chat/pins/WidgetChannelPinnedMessages.java b/app/src/main/java/com/discord/widgets/chat/pins/WidgetChannelPinnedMessages.java index ffd74e675f..a6688549b3 100644 --- a/app/src/main/java/com/discord/widgets/chat/pins/WidgetChannelPinnedMessages.java +++ b/app/src/main/java/com/discord/widgets/chat/pins/WidgetChannelPinnedMessages.java @@ -287,9 +287,9 @@ public final class WidgetChannelPinnedMessages extends AppFragment { public final Observable get(Context context, long j) { m.checkNotNullParameter(context, "context"); StoreStream.Companion companion = StoreStream.Companion; - Channel findChannelByIdInternal$app_productionBetaRelease = companion.getChannels().findChannelByIdInternal$app_productionBetaRelease(j); - if (findChannelByIdInternal$app_productionBetaRelease != null) { - Observable Y = companion.getPinnedMessages().observeForChannel(j).Y(new WidgetChannelPinnedMessages$Model$Companion$get$1(findChannelByIdInternal$app_productionBetaRelease, context)); + Channel findChannelById = companion.getChannels().findChannelById(j); + if (findChannelById != null) { + Observable Y = companion.getPinnedMessages().observeForChannel(j).Y(new WidgetChannelPinnedMessages$Model$Companion$get$1(findChannelById, context)); m.checkNotNullExpressionValue(Y, "getPinnedMessages().obseā€¦ }\n }"); return Y; } diff --git a/app/src/main/java/com/discord/widgets/guilds/join/ChannelViewHolder.java b/app/src/main/java/com/discord/widgets/guilds/join/ChannelViewHolder.java index 92c0891bcb..b574013d88 100644 --- a/app/src/main/java/com/discord/widgets/guilds/join/ChannelViewHolder.java +++ b/app/src/main/java/com/discord/widgets/guilds/join/ChannelViewHolder.java @@ -44,9 +44,9 @@ public final class ChannelViewHolder extends BaseChannelViewHolder { textView.setText(channelData.getWelcomeChannel().b()); TextView textView2 = this.binding.e; m.checkNotNullExpressionValue(textView2, "binding.guildWelcomeChannelName"); - Channel findChannelByIdInternal$app_productionBetaRelease = StoreStream.Companion.getChannels().findChannelByIdInternal$app_productionBetaRelease(channelData.getWelcomeChannel().a()); - if (findChannelByIdInternal$app_productionBetaRelease != null) { - str = ChannelUtils.c(findChannelByIdInternal$app_productionBetaRelease); + Channel findChannelById = StoreStream.Companion.getChannels().findChannelById(channelData.getWelcomeChannel().a()); + if (findChannelById != null) { + str = ChannelUtils.c(findChannelById); } textView2.setText(String.valueOf(str)); this.binding.b.setOnClickListener(new ChannelViewHolder$bind$1(channelItem)); diff --git a/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java b/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java index 9ee7993f78..34943b39f6 100644 --- a/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java +++ b/app/src/main/java/com/discord/widgets/settings/WidgetSettings.java @@ -346,7 +346,7 @@ public final class WidgetSettings extends AppFragment implements OnTabSelectedLi TextView textView = binding.f; m.checkNotNullExpressionValue(textView, "appInfoHeader"); String string = getString(R.string.app_information); - textView.setText(string + " - 102.7 - Beta (102107)"); + textView.setText(string + " - 102.8 - Beta (102108)"); binding.B.setOnClickListener(new WidgetSettings$onViewBound$$inlined$with$lambda$3(this)); binding.u.setOnClickListener(WidgetSettings$onViewBound$1$5.INSTANCE); binding.q.setOnClickListener(WidgetSettings$onViewBound$1$6.INSTANCE); diff --git a/app/src/main/java/com/discord/widgets/stickers/WidgetStickerSheet.java b/app/src/main/java/com/discord/widgets/stickers/WidgetStickerSheet.java index de6bae0e8f..16d8eea587 100644 --- a/app/src/main/java/com/discord/widgets/stickers/WidgetStickerSheet.java +++ b/app/src/main/java/com/discord/widgets/stickers/WidgetStickerSheet.java @@ -56,11 +56,11 @@ public final class WidgetStickerSheet extends AppBottomSheet { } public final void show(FragmentManager fragmentManager, Sticker sticker, long j) { - Channel findChannelByIdInternal$app_productionBetaRelease; + Channel findChannelById; m.checkNotNullParameter(fragmentManager, "fragmentManager"); m.checkNotNullParameter(sticker, "sticker"); - if (sticker.k() == StickerType.STANDARD && (findChannelByIdInternal$app_productionBetaRelease = StoreStream.Companion.getChannels().findChannelByIdInternal$app_productionBetaRelease(j)) != null) { - String str = findChannelByIdInternal$app_productionBetaRelease.f() == 0 ? "DM Channel" : Traits.Location.Page.GUILD_CHANNEL; + if (sticker.k() == StickerType.STANDARD && (findChannelById = StoreStream.Companion.getChannels().findChannelById(j)) != null) { + String str = findChannelById.f() == 0 ? "DM Channel" : Traits.Location.Page.GUILD_CHANNEL; WidgetStickerSheet widgetStickerSheet = new WidgetStickerSheet(); Bundle bundle = new Bundle(); bundle.putSerializable("com.discord.intent.extra.EXTRA_STICKER", sticker); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2dec97cd8f..0516c71442 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1505,7 +1505,7 @@ Select a color Transparency Use Default - f16b366e8d0f446d8dfd549fdec79087 + 9829ea7736fa44f496b851ce59dbaf13 Coming Soon Slash command application {applicationName} {applicationName} application