discord-jadx/app/src/main/java/com/discord/widgets/chat/list/adapter/WidgetChatListAdapterItemSt...

589 lines
31 KiB
Java

package com.discord.widgets.chat.list.adapter;
import a0.a.a.b;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import b.a.y.p0.d;
import b.d.b.a.a;
import com.discord.R;
import com.discord.api.channel.Channel;
import com.discord.api.guild.Guild;
import com.discord.api.guildmember.GuildMember;
import com.discord.api.stageinstance.RecommendedStageInstance;
import com.discord.api.stageinstance.StageInstance;
import com.discord.databinding.WidgetChatListAdapterItemStageInviteBinding;
import com.discord.models.domain.ModelInvite;
import com.discord.models.member.GuildMember;
import com.discord.models.user.CoreUser;
import com.discord.models.user.User;
import com.discord.stores.StoreAccessibility;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StoreInstantInvites;
import com.discord.stores.StoreRequestedStageChannels;
import com.discord.stores.StoreStageChannels;
import com.discord.stores.StoreStageInstances;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreUser;
import com.discord.stores.updates.ObservationDeck;
import com.discord.stores.updates.ObservationDeckProvider;
import com.discord.utilities.guilds.GuildUtilsKt;
import com.discord.utilities.icon.IconUtils;
import com.discord.utilities.images.MGImages;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.discord.utilities.rx.ObservableExtensionsKt$filterNull$1;
import com.discord.utilities.rx.ObservableExtensionsKt$filterNull$2;
import com.discord.utilities.view.extensions.ViewExtensions;
import com.discord.views.stages.StageCardSpeakersView;
import com.discord.widgets.chat.list.entries.ChatListEntry;
import com.discord.widgets.chat.list.entries.StageInviteEntry;
import com.discord.widgets.stage.StageCardSpeaker;
import com.discord.widgets.stage.StageRoles;
import com.facebook.drawee.view.SimpleDraweeView;
import com.google.android.material.button.MaterialButton;
import d0.t.n;
import d0.t.o;
import d0.t.u;
import d0.z.d.m;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlinx.coroutines.Job;
import rx.Observable;
import rx.Subscription;
/* compiled from: WidgetChatListAdapterItemStageInvite.kt */
public final class WidgetChatListAdapterItemStageInvite extends WidgetChatListAdapterItemInviteBase {
private final WidgetChatListAdapterItemStageInviteBinding binding;
private String iconUrl;
private Job inviteJoinJob;
private StageInviteEntry item;
private Subscription subscription;
/* compiled from: WidgetChatListAdapterItemStageInvite.kt */
public static final class Model {
public static final Companion Companion = new Companion(null);
private final User authorUser;
private final Channel channel;
private final ModelInvite invite;
private final Integer listenersCount;
private final long meId;
private final boolean shouldAnimateGuildIcon;
private final List<StageCardSpeaker> speakers;
private final StageInstance stageInstance;
/* compiled from: WidgetChatListAdapterItemStageInvite.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public static final /* synthetic */ List access$speakersFromLocalStore(Companion companion, StoreGuilds storeGuilds, StoreUser storeUser, StoreStageChannels storeStageChannels, long j, long j2) {
return companion.speakersFromLocalStore(storeGuilds, storeUser, storeStageChannels, j, j2);
}
public static final /* synthetic */ List access$speakersFromRequest(Companion companion, StoreRequestedStageChannels.StageInstanceState stageInstanceState) {
return companion.speakersFromRequest(stageInstanceState);
}
public static /* synthetic */ Observable observe$default(Companion companion, StageInviteEntry stageInviteEntry, StoreUser storeUser, StoreChannels storeChannels, StoreGuilds storeGuilds, StoreAccessibility storeAccessibility, StoreStageInstances storeStageInstances, StoreRequestedStageChannels storeRequestedStageChannels, StoreStageChannels storeStageChannels, ObservationDeck observationDeck, int i, Object obj) {
return companion.observe(stageInviteEntry, (i & 2) != 0 ? StoreStream.Companion.getUsers() : storeUser, (i & 4) != 0 ? StoreStream.Companion.getChannels() : storeChannels, (i & 8) != 0 ? StoreStream.Companion.getGuilds() : storeGuilds, (i & 16) != 0 ? StoreStream.Companion.getAccessibility() : storeAccessibility, (i & 32) != 0 ? StoreStream.Companion.getStageInstances() : storeStageInstances, (i & 64) != 0 ? StoreStream.Companion.getRequestedStageChannels() : storeRequestedStageChannels, (i & 128) != 0 ? StoreStream.Companion.getStageChannels() : storeStageChannels, (i & 256) != 0 ? ObservationDeckProvider.get() : observationDeck);
}
private final List<StageCardSpeaker> speakersFromLocalStore(StoreGuilds storeGuilds, StoreUser storeUser, StoreStageChannels storeStageChannels, long j, long j2) {
User user;
Map<Long, StageRoles> channelRoles = storeStageChannels.getChannelRoles(j);
if (channelRoles == null) {
return null;
}
ArrayList arrayList = new ArrayList();
for (Map.Entry<Long, StageRoles> entry : channelRoles.entrySet()) {
long longValue = entry.getKey().longValue();
StageCardSpeaker stageCardSpeaker = (!StageRoles.m27isSpeakerimpl(entry.getValue().m29unboximpl()) || (user = storeUser.getUsers().get(Long.valueOf(longValue))) == null) ? null : Model.Companion.toStageCardSpeaker(user, storeGuilds.getMember(j2, longValue));
if (stageCardSpeaker != null) {
arrayList.add(stageCardSpeaker);
}
}
return arrayList;
}
private final List<StageCardSpeaker> speakersFromRequest(StoreRequestedStageChannels.StageInstanceState stageInstanceState) {
RecommendedStageInstance stageInstance;
if (stageInstanceState == null || (stageInstance = stageInstanceState.getStageInstance()) == null) {
return null;
}
List<GuildMember> c = stageInstance.c();
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(c, 10));
for (GuildMember guildMember : c) {
arrayList.add(new StageCardSpeaker(new CoreUser(guildMember.m()), GuildMember.Companion.from$default(com.discord.models.member.GuildMember.Companion, guildMember, guildMember.f(), null, StoreStream.Companion.getGuilds(), 4, null)));
}
return arrayList;
}
private final StageCardSpeaker toStageCardSpeaker(User user, com.discord.models.member.GuildMember guildMember) {
return new StageCardSpeaker(user, guildMember);
}
public final Observable<Model> observe(StageInviteEntry stageInviteEntry, StoreUser storeUser, StoreChannels storeChannels, StoreGuilds storeGuilds, StoreAccessibility storeAccessibility, StoreStageInstances storeStageInstances, StoreRequestedStageChannels storeRequestedStageChannels, StoreStageChannels storeStageChannels, ObservationDeck observationDeck) {
m.checkNotNullParameter(stageInviteEntry, "item");
m.checkNotNullParameter(storeUser, "userStore");
m.checkNotNullParameter(storeChannels, "channelStore");
m.checkNotNullParameter(storeGuilds, "guildStore");
m.checkNotNullParameter(storeAccessibility, "accessibilityStore");
m.checkNotNullParameter(storeStageInstances, "stageInstanceStore");
m.checkNotNullParameter(storeRequestedStageChannels, "requestedInstanceStore");
m.checkNotNullParameter(storeStageChannels, "stageChannelStore");
m.checkNotNullParameter(observationDeck, "observationDeck");
return ObservationDeck.connectRx$default(observationDeck, new ObservationDeck.UpdateSource[]{storeUser, storeChannels, storeGuilds, storeAccessibility, storeStageInstances, storeRequestedStageChannels, storeStageChannels}, false, null, null, new WidgetChatListAdapterItemStageInvite$Model$Companion$observe$1(storeUser, stageInviteEntry, storeChannels, storeAccessibility, storeStageInstances, storeRequestedStageChannels, storeStageChannels, storeGuilds), 14, null);
}
}
public Model(ModelInvite modelInvite, long j, User user, Channel channel, boolean z2, StageInstance stageInstance, List<StageCardSpeaker> list, Integer num) {
m.checkNotNullParameter(modelInvite, "invite");
m.checkNotNullParameter(list, "speakers");
this.invite = modelInvite;
this.meId = j;
this.authorUser = user;
this.channel = channel;
this.shouldAnimateGuildIcon = z2;
this.stageInstance = stageInstance;
this.speakers = list;
this.listenersCount = num;
}
public static /* synthetic */ Model copy$default(Model model, ModelInvite modelInvite, long j, User user, Channel channel, boolean z2, StageInstance stageInstance, List list, Integer num, int i, Object obj) {
return model.copy((i & 1) != 0 ? model.invite : modelInvite, (i & 2) != 0 ? model.meId : j, (i & 4) != 0 ? model.authorUser : user, (i & 8) != 0 ? model.channel : channel, (i & 16) != 0 ? model.shouldAnimateGuildIcon : z2, (i & 32) != 0 ? model.stageInstance : stageInstance, (i & 64) != 0 ? model.speakers : list, (i & 128) != 0 ? model.listenersCount : num);
}
public final ModelInvite component1() {
return this.invite;
}
public final long component2() {
return this.meId;
}
public final User component3() {
return this.authorUser;
}
public final Channel component4() {
return this.channel;
}
public final boolean component5() {
return this.shouldAnimateGuildIcon;
}
public final StageInstance component6() {
return this.stageInstance;
}
public final List<StageCardSpeaker> component7() {
return this.speakers;
}
public final Integer component8() {
return this.listenersCount;
}
public final Model copy(ModelInvite modelInvite, long j, User user, Channel channel, boolean z2, StageInstance stageInstance, List<StageCardSpeaker> list, Integer num) {
m.checkNotNullParameter(modelInvite, "invite");
m.checkNotNullParameter(list, "speakers");
return new Model(modelInvite, j, user, channel, z2, stageInstance, list, num);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Model)) {
return false;
}
Model model = (Model) obj;
return m.areEqual(this.invite, model.invite) && this.meId == model.meId && m.areEqual(this.authorUser, model.authorUser) && m.areEqual(this.channel, model.channel) && this.shouldAnimateGuildIcon == model.shouldAnimateGuildIcon && m.areEqual(this.stageInstance, model.stageInstance) && m.areEqual(this.speakers, model.speakers) && m.areEqual(this.listenersCount, model.listenersCount);
}
public final User getAuthorUser() {
return this.authorUser;
}
public final Channel getChannel() {
return this.channel;
}
public final ModelInvite getInvite() {
return this.invite;
}
public final Integer getListenersCount() {
return this.listenersCount;
}
public final long getMeId() {
return this.meId;
}
public final boolean getShouldAnimateGuildIcon() {
return this.shouldAnimateGuildIcon;
}
public final List<StageCardSpeaker> getSpeakers() {
return this.speakers;
}
public final StageInstance getStageInstance() {
return this.stageInstance;
}
public int hashCode() {
ModelInvite modelInvite = this.invite;
int i = 0;
int a = (b.a(this.meId) + ((modelInvite != null ? modelInvite.hashCode() : 0) * 31)) * 31;
User user = this.authorUser;
int hashCode = (a + (user != null ? user.hashCode() : 0)) * 31;
Channel channel = this.channel;
int hashCode2 = (hashCode + (channel != null ? channel.hashCode() : 0)) * 31;
boolean z2 = this.shouldAnimateGuildIcon;
if (z2) {
z2 = true;
}
int i2 = z2 ? 1 : 0;
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = (hashCode2 + i2) * 31;
StageInstance stageInstance = this.stageInstance;
int hashCode3 = (i5 + (stageInstance != null ? stageInstance.hashCode() : 0)) * 31;
List<StageCardSpeaker> list = this.speakers;
int hashCode4 = (hashCode3 + (list != null ? list.hashCode() : 0)) * 31;
Integer num = this.listenersCount;
if (num != null) {
i = num.hashCode();
}
return hashCode4 + i;
}
public String toString() {
StringBuilder R = a.R("Model(invite=");
R.append(this.invite);
R.append(", meId=");
R.append(this.meId);
R.append(", authorUser=");
R.append(this.authorUser);
R.append(", channel=");
R.append(this.channel);
R.append(", shouldAnimateGuildIcon=");
R.append(this.shouldAnimateGuildIcon);
R.append(", stageInstance=");
R.append(this.stageInstance);
R.append(", speakers=");
R.append(this.speakers);
R.append(", listenersCount=");
return a.E(R, this.listenersCount, ")");
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetChatListAdapterItemStageInvite(WidgetChatListAdapter widgetChatListAdapter) {
super(R.layout.widget_chat_list_adapter_item_stage_invite, widgetChatListAdapter);
m.checkNotNullParameter(widgetChatListAdapter, "adapter");
View view = this.itemView;
int i = R.id.item_invite_channel_topic;
TextView textView = (TextView) view.findViewById(R.id.item_invite_channel_topic);
if (textView != null) {
i = R.id.item_invite_guild_name;
TextView textView2 = (TextView) view.findViewById(R.id.item_invite_guild_name);
if (textView2 != null) {
i = R.id.item_invite_header;
TextView textView3 = (TextView) view.findViewById(R.id.item_invite_header);
if (textView3 != null) {
i = R.id.item_invite_image;
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) view.findViewById(R.id.item_invite_image);
if (simpleDraweeView != null) {
i = R.id.item_invite_image_text;
TextView textView4 = (TextView) view.findViewById(R.id.item_invite_image_text);
if (textView4 != null) {
i = R.id.item_invite_join_button;
MaterialButton materialButton = (MaterialButton) view.findViewById(R.id.item_invite_join_button);
if (materialButton != null) {
ConstraintLayout constraintLayout = (ConstraintLayout) view;
i = R.id.item_listeners_count;
TextView textView5 = (TextView) view.findViewById(R.id.item_listeners_count);
if (textView5 != null) {
i = R.id.stage_discovery_speakers_view;
StageCardSpeakersView stageCardSpeakersView = (StageCardSpeakersView) view.findViewById(R.id.stage_discovery_speakers_view);
if (stageCardSpeakersView != null) {
WidgetChatListAdapterItemStageInviteBinding widgetChatListAdapterItemStageInviteBinding = new WidgetChatListAdapterItemStageInviteBinding(constraintLayout, textView, textView2, textView3, simpleDraweeView, textView4, materialButton, constraintLayout, textView5, stageCardSpeakersView);
m.checkNotNullExpressionValue(widgetChatListAdapterItemStageInviteBinding, "WidgetChatListAdapterIte…iteBinding.bind(itemView)");
this.binding = widgetChatListAdapterItemStageInviteBinding;
return;
}
}
}
}
}
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(view.getResources().getResourceName(i)));
}
public static final /* synthetic */ void access$configureUI(WidgetChatListAdapterItemStageInvite widgetChatListAdapterItemStageInvite, Model model) {
widgetChatListAdapterItemStageInvite.configureUI(model);
}
public static final /* synthetic */ WidgetChatListAdapter access$getAdapter$p(WidgetChatListAdapterItemStageInvite widgetChatListAdapterItemStageInvite) {
return (WidgetChatListAdapter) widgetChatListAdapterItemStageInvite.adapter;
}
public static final /* synthetic */ Job access$getInviteJoinJob$p(WidgetChatListAdapterItemStageInvite widgetChatListAdapterItemStageInvite) {
return widgetChatListAdapterItemStageInvite.inviteJoinJob;
}
public static final /* synthetic */ Subscription access$getSubscription$p(WidgetChatListAdapterItemStageInvite widgetChatListAdapterItemStageInvite) {
return widgetChatListAdapterItemStageInvite.subscription;
}
public static final /* synthetic */ void access$setInviteJoinJob$p(WidgetChatListAdapterItemStageInvite widgetChatListAdapterItemStageInvite, Job job) {
widgetChatListAdapterItemStageInvite.inviteJoinJob = job;
}
public static final /* synthetic */ void access$setSubscription$p(WidgetChatListAdapterItemStageInvite widgetChatListAdapterItemStageInvite, Subscription subscription) {
widgetChatListAdapterItemStageInvite.subscription = subscription;
}
/* JADX DEBUG: TODO: convert one arg to string using `String.valueOf()`, args: [(r5v14 int), ('-' char), (r3v2 int)] */
/* JADX DEBUG: TODO: convert one arg to string using `String.valueOf()`, args: [(r5v14 int), ('-' char), (wrap: int : 0x0181: ARITH (r5v16 int) = (wrap: int : 0x017d: INVOKE (r5v15 int) = (r6v3 java.util.ArrayList) type: VIRTUAL call: java.util.ArrayList.size():int) + (1 int))] */
/* JADX WARNING: Removed duplicated region for block: B:33:0x009d */
/* JADX WARNING: Removed duplicated region for block: B:34:0x00a2 */
/* JADX WARNING: Removed duplicated region for block: B:41:0x00c2 */
/* JADX WARNING: Removed duplicated region for block: B:42:0x00c7 */
/* JADX WARNING: Removed duplicated region for block: B:44:0x00cb */
/* JADX WARNING: Removed duplicated region for block: B:50:0x00e9 */
/* JADX WARNING: Removed duplicated region for block: B:54:0x0126 */
/* JADX WARNING: Removed duplicated region for block: B:60:0x0170 */
private final void configureUI(Model model) {
boolean z2;
String str;
String str2;
Integer listenersCount;
int size;
Guild guild;
String x2;
String q;
View view = this.itemView;
m.checkNotNullExpressionValue(view, "itemView");
Context context = view.getContext();
Guild guild2 = model.getInvite().guild;
String str3 = null;
Long valueOf = guild2 != null ? Long.valueOf(guild2.r()) : null;
Guild guild3 = model.getInvite().guild;
updateIconUrlIfChanged(IconUtils.getForGuild$default(valueOf, guild3 != null ? guild3.q() : null, IconUtils.DEFAULT_ICON_BLURPLE, model.getShouldAnimateGuildIcon(), null, 16, null));
Guild guild4 = model.getInvite().guild;
int i = 0;
if (!(guild4 == null || (q = guild4.q()) == null)) {
if (q.length() > 0) {
z2 = true;
TextView textView = this.binding.e;
m.checkNotNullExpressionValue(textView, "binding.itemInviteImageText");
ViewExtensions.setTextAndVisibilityBy(textView, (z2 || (guild = model.getInvite().guild) == null || (x2 = guild.x()) == null) ? null : GuildUtilsKt.computeShortName(x2));
TextView textView2 = this.binding.c;
m.checkNotNullExpressionValue(textView2, "binding.itemInviteGuildName");
Guild guild5 = model.getInvite().guild;
if (guild5 == null || (str = guild5.x()) == null) {
Channel channel = model.getChannel();
str = channel != null ? channel.m() : null;
}
ViewExtensions.setTextAndVisibilityBy(textView2, str);
TextView textView3 = this.binding.f2301b;
m.checkNotNullExpressionValue(textView3, "binding.itemInviteChannelTopic");
StageInstance stageInstance = model.getStageInstance();
if (stageInstance == null || (str2 = stageInstance.f()) == null) {
Channel channel2 = model.getChannel();
str2 = channel2 != null ? channel2.z() : null;
}
if (str2 == null) {
Channel channel3 = model.getChannel();
str2 = channel3 != null ? channel3.m() : null;
}
ViewExtensions.setTextAndVisibilityBy(textView3, str2);
TextView textView4 = this.binding.g;
m.checkNotNullExpressionValue(textView4, "binding.itemListenersCount");
listenersCount = model.getListenersCount();
if (listenersCount != null) {
str3 = String.valueOf(listenersCount.intValue());
}
ViewExtensions.setTextAndVisibilityBy(textView4, str3);
StageCardSpeakersView stageCardSpeakersView = this.binding.h;
List<StageCardSpeaker> speakers = model.getSpeakers();
RecyclerView.ItemDecoration itemDecoration = StageCardSpeakersView.j;
int size2 = speakers.size();
Objects.requireNonNull(stageCardSpeakersView);
m.checkNotNullParameter(speakers, "speakers");
List take = u.take(speakers, 3);
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(take, 10));
for (Object obj : take) {
int i2 = i + 1;
if (i < 0) {
n.throwIndexOverflow();
}
StageCardSpeaker stageCardSpeaker = (StageCardSpeaker) obj;
User user = stageCardSpeaker.getUser();
com.discord.models.member.GuildMember guildMember = stageCardSpeaker.getGuildMember();
String displayName = stageCardSpeaker.getDisplayName();
StringBuilder sb = new StringBuilder();
sb.append(size2);
sb.append('-');
sb.append(i);
arrayList.add(new d.a(user, guildMember, displayName, sb.toString()));
i = i2;
}
size = size2 - arrayList.size();
m.checkNotNullParameter(arrayList, "speakersToDisplay");
ArrayList arrayList2 = new ArrayList();
arrayList2.addAll(arrayList);
if (size > 0) {
StringBuilder sb2 = new StringBuilder();
sb2.append(size2);
sb2.append('-');
sb2.append(arrayList.size() + 1);
arrayList2.add(new d.b(size, sb2.toString()));
}
stageCardSpeakersView.l.setData(arrayList2);
this.binding.f.setOnClickListener(new WidgetChatListAdapterItemStageInvite$configureUI$2(this, model, context));
}
}
z2 = false;
TextView textView = this.binding.e;
m.checkNotNullExpressionValue(textView, "binding.itemInviteImageText");
if (z2) {
ViewExtensions.setTextAndVisibilityBy(textView, (z2 || (guild = model.getInvite().guild) == null || (x2 = guild.x()) == null) ? null : GuildUtilsKt.computeShortName(x2));
TextView textView2 = this.binding.c;
m.checkNotNullExpressionValue(textView2, "binding.itemInviteGuildName");
Guild guild5 = model.getInvite().guild;
Channel channel = model.getChannel();
if (channel != null) {
}
ViewExtensions.setTextAndVisibilityBy(textView2, str);
TextView textView3 = this.binding.f2301b;
m.checkNotNullExpressionValue(textView3, "binding.itemInviteChannelTopic");
StageInstance stageInstance = model.getStageInstance();
Channel channel2 = model.getChannel();
if (channel2 != null) {
}
if (str2 == null) {
}
ViewExtensions.setTextAndVisibilityBy(textView3, str2);
TextView textView4 = this.binding.g;
m.checkNotNullExpressionValue(textView4, "binding.itemListenersCount");
listenersCount = model.getListenersCount();
if (listenersCount != null) {
}
ViewExtensions.setTextAndVisibilityBy(textView4, str3);
StageCardSpeakersView stageCardSpeakersView = this.binding.h;
List<StageCardSpeaker> speakers = model.getSpeakers();
RecyclerView.ItemDecoration itemDecoration = StageCardSpeakersView.j;
int size2 = speakers.size();
Objects.requireNonNull(stageCardSpeakersView);
m.checkNotNullParameter(speakers, "speakers");
List take = u.take(speakers, 3);
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(take, 10));
while (r2.hasNext()) {
}
size = size2 - arrayList.size();
m.checkNotNullParameter(arrayList, "speakersToDisplay");
ArrayList arrayList2 = new ArrayList();
arrayList2.addAll(arrayList);
if (size > 0) {
}
stageCardSpeakersView.l.setData(arrayList2);
this.binding.f.setOnClickListener(new WidgetChatListAdapterItemStageInvite$configureUI$2(this, model, context));
}
ViewExtensions.setTextAndVisibilityBy(textView, (z2 || (guild = model.getInvite().guild) == null || (x2 = guild.x()) == null) ? null : GuildUtilsKt.computeShortName(x2));
TextView textView2 = this.binding.c;
m.checkNotNullExpressionValue(textView2, "binding.itemInviteGuildName");
Guild guild5 = model.getInvite().guild;
Channel channel = model.getChannel();
if (channel != null) {
}
ViewExtensions.setTextAndVisibilityBy(textView2, str);
TextView textView3 = this.binding.f2301b;
m.checkNotNullExpressionValue(textView3, "binding.itemInviteChannelTopic");
StageInstance stageInstance = model.getStageInstance();
Channel channel2 = model.getChannel();
if (channel2 != null) {
}
if (str2 == null) {
}
ViewExtensions.setTextAndVisibilityBy(textView3, str2);
TextView textView4 = this.binding.g;
m.checkNotNullExpressionValue(textView4, "binding.itemListenersCount");
listenersCount = model.getListenersCount();
if (listenersCount != null) {
}
ViewExtensions.setTextAndVisibilityBy(textView4, str3);
StageCardSpeakersView stageCardSpeakersView = this.binding.h;
List<StageCardSpeaker> speakers = model.getSpeakers();
RecyclerView.ItemDecoration itemDecoration = StageCardSpeakersView.j;
int size2 = speakers.size();
Objects.requireNonNull(stageCardSpeakersView);
m.checkNotNullParameter(speakers, "speakers");
List take = u.take(speakers, 3);
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(take, 10));
while (r2.hasNext()) {
}
size = size2 - arrayList.size();
m.checkNotNullParameter(arrayList, "speakersToDisplay");
ArrayList arrayList2 = new ArrayList();
arrayList2.addAll(arrayList);
if (size > 0) {
}
stageCardSpeakersView.l.setData(arrayList2);
this.binding.f.setOnClickListener(new WidgetChatListAdapterItemStageInvite$configureUI$2(this, model, context));
}
private final void updateIconUrlIfChanged(String str) {
if (!m.areEqual(this.iconUrl, str)) {
SimpleDraweeView simpleDraweeView = this.binding.d;
m.checkNotNullExpressionValue(simpleDraweeView, "binding.itemInviteImage");
IconUtils.setIcon$default(simpleDraweeView, str, (int) R.dimen.avatar_size_large, (Function1) null, (MGImages.ChangeDetector) null, 24, (Object) null);
this.iconUrl = str;
}
}
@Override // com.discord.utilities.mg_recycler.MGRecyclerViewHolder
public Subscription getSubscription() {
return this.subscription;
}
@Override // com.discord.widgets.chat.list.adapter.WidgetChatListItem
public void onConfigure(int i, ChatListEntry chatListEntry) {
m.checkNotNullParameter(chatListEntry, "data");
super.onConfigure(i, chatListEntry);
this.item = (StageInviteEntry) chatListEntry;
StoreInstantInvites instantInvites = StoreStream.Companion.getInstantInvites();
StageInviteEntry stageInviteEntry = this.item;
if (stageInviteEntry == null) {
m.throwUninitializedPropertyAccessException("item");
}
StoreInstantInvites.fetchInviteIfNotLoaded$default(instantInvites, stageInviteEntry.getInviteCode(), null, "Invite Button Embed", null, null, 26, null);
Model.Companion companion = Model.Companion;
StageInviteEntry stageInviteEntry2 = this.item;
if (stageInviteEntry2 == null) {
m.throwUninitializedPropertyAccessException("item");
}
Observable F = ObservableExtensionsKt.ui(Model.Companion.observe$default(companion, stageInviteEntry2, null, null, null, null, null, null, null, null, 510, null)).x(ObservableExtensionsKt$filterNull$1.INSTANCE).F(ObservableExtensionsKt$filterNull$2.INSTANCE);
m.checkNotNullExpressionValue(F, "filter { it != null }.map { it!! }");
ObservableExtensionsKt.appSubscribe$default(F, WidgetChatListAdapterItemStageInvite.class, (Context) null, new WidgetChatListAdapterItemStageInvite$onConfigure$2(this), (Function1) null, (Function0) null, (Function0) null, new WidgetChatListAdapterItemStageInvite$onConfigure$1(this), 58, (Object) null);
}
}