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

333 lines
17 KiB
Java

package com.discord.widgets.chat.list.adapter;
import android.content.Context;
import android.view.View;
import c.d.b.a.a;
import com.discord.R;
import com.discord.api.channel.Channel;
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
import com.discord.databinding.WidgetChatListAdapterItemGuildScheduledEventInviteBinding;
import com.discord.models.domain.ModelInvite;
import com.discord.models.guild.Guild;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreGuildScheduledEvents;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreUser;
import com.discord.stores.StoreVoiceChannelSelected;
import com.discord.stores.updates.ObservationDeck;
import com.discord.stores.updates.ObservationDeckProvider;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.discord.widgets.chat.list.entries.ChatListEntry;
import com.discord.widgets.chat.list.entries.GuildScheduledEventInviteEntry;
import com.discord.widgets.guildscheduledevent.GuildScheduledEventItemView;
import d0.z.d.m;
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: WidgetChatListAdapterItemGuildScheduledEventInvite.kt */
public final class WidgetChatListAdapterItemGuildScheduledEventInvite extends WidgetChatListAdapterItemInviteBase {
private final WidgetChatListAdapterItemGuildScheduledEventInviteBinding binding;
private final StoreGuildScheduledEvents guildScheduledEventStore;
private Job inviteJoinJob;
private Subscription subscription;
/* compiled from: WidgetChatListAdapterItemGuildScheduledEventInvite.kt */
public static final class Model {
public static final Companion Companion = new Companion(null);
private final Channel channel;
private final Guild guild;
private final GuildScheduledEvent guildScheduledEvent;
private final ModelInvite invite;
private final boolean isInGuild;
private final boolean isRsvped;
private final Long selectedVoiceChannelId;
/* compiled from: WidgetChatListAdapterItemGuildScheduledEventInvite.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public static /* synthetic */ Observable observe$default(Companion companion, GuildScheduledEventInviteEntry guildScheduledEventInviteEntry, StoreGuilds storeGuilds, StoreUser storeUser, StoreChannels storeChannels, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreVoiceChannelSelected storeVoiceChannelSelected, int i, Object obj) {
if ((i & 2) != 0) {
storeGuilds = StoreStream.Companion.getGuilds();
}
if ((i & 4) != 0) {
storeUser = StoreStream.Companion.getUsers();
}
if ((i & 8) != 0) {
storeChannels = StoreStream.Companion.getChannels();
}
if ((i & 16) != 0) {
storeGuildScheduledEvents = StoreStream.Companion.getGuildScheduledEvents();
}
if ((i & 32) != 0) {
storeVoiceChannelSelected = StoreStream.Companion.getVoiceChannelSelected();
}
return companion.observe(guildScheduledEventInviteEntry, storeGuilds, storeUser, storeChannels, storeGuildScheduledEvents, storeVoiceChannelSelected);
}
public final Observable<Model> observe(GuildScheduledEventInviteEntry guildScheduledEventInviteEntry, StoreGuilds storeGuilds, StoreUser storeUser, StoreChannels storeChannels, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreVoiceChannelSelected storeVoiceChannelSelected) {
m.checkNotNullParameter(guildScheduledEventInviteEntry, "item");
m.checkNotNullParameter(storeGuilds, "guildStore");
m.checkNotNullParameter(storeUser, "userStore");
m.checkNotNullParameter(storeChannels, "channelStore");
m.checkNotNullParameter(storeGuildScheduledEvents, "guildScheduledEventStore");
m.checkNotNullParameter(storeVoiceChannelSelected, "voiceChannelSelectedStore");
return ObservationDeck.connectRx$default(ObservationDeckProvider.get(), new ObservationDeck.UpdateSource[]{storeGuilds, storeUser, storeGuildScheduledEvents, storeVoiceChannelSelected}, false, null, null, new WidgetChatListAdapterItemGuildScheduledEventInvite$Model$Companion$observe$1(guildScheduledEventInviteEntry, storeGuilds, storeUser, storeGuildScheduledEvents, storeChannels, storeVoiceChannelSelected), 14, null);
}
}
public Model(ModelInvite modelInvite, boolean z2, boolean z3, GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, Long l) {
m.checkNotNullParameter(modelInvite, "invite");
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
this.invite = modelInvite;
this.isInGuild = z2;
this.isRsvped = z3;
this.guildScheduledEvent = guildScheduledEvent;
this.channel = channel;
this.guild = guild;
this.selectedVoiceChannelId = l;
}
public static /* synthetic */ Model copy$default(Model model, ModelInvite modelInvite, boolean z2, boolean z3, GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, Long l, int i, Object obj) {
if ((i & 1) != 0) {
modelInvite = model.invite;
}
if ((i & 2) != 0) {
z2 = model.isInGuild;
}
if ((i & 4) != 0) {
z3 = model.isRsvped;
}
if ((i & 8) != 0) {
guildScheduledEvent = model.guildScheduledEvent;
}
if ((i & 16) != 0) {
channel = model.channel;
}
if ((i & 32) != 0) {
guild = model.guild;
}
if ((i & 64) != 0) {
l = model.selectedVoiceChannelId;
}
return model.copy(modelInvite, z2, z3, guildScheduledEvent, channel, guild, l);
}
public final ModelInvite component1() {
return this.invite;
}
public final boolean component2() {
return this.isInGuild;
}
public final boolean component3() {
return this.isRsvped;
}
public final GuildScheduledEvent component4() {
return this.guildScheduledEvent;
}
public final Channel component5() {
return this.channel;
}
public final Guild component6() {
return this.guild;
}
public final Long component7() {
return this.selectedVoiceChannelId;
}
public final Model copy(ModelInvite modelInvite, boolean z2, boolean z3, GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, Long l) {
m.checkNotNullParameter(modelInvite, "invite");
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
return new Model(modelInvite, z2, z3, guildScheduledEvent, channel, guild, l);
}
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.isInGuild == model.isInGuild && this.isRsvped == model.isRsvped && m.areEqual(this.guildScheduledEvent, model.guildScheduledEvent) && m.areEqual(this.channel, model.channel) && m.areEqual(this.guild, model.guild) && m.areEqual(this.selectedVoiceChannelId, model.selectedVoiceChannelId);
}
public final Channel getChannel() {
return this.channel;
}
public final Guild getGuild() {
return this.guild;
}
public final GuildScheduledEvent getGuildScheduledEvent() {
return this.guildScheduledEvent;
}
public final ModelInvite getInvite() {
return this.invite;
}
public final Long getSelectedVoiceChannelId() {
return this.selectedVoiceChannelId;
}
public int hashCode() {
ModelInvite modelInvite = this.invite;
int i = 0;
int hashCode = (modelInvite != null ? modelInvite.hashCode() : 0) * 31;
boolean z2 = this.isInGuild;
int i2 = 1;
if (z2) {
z2 = true;
}
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = (hashCode + i3) * 31;
boolean z3 = this.isRsvped;
if (!z3) {
i2 = z3 ? 1 : 0;
}
int i7 = (i6 + i2) * 31;
GuildScheduledEvent guildScheduledEvent = this.guildScheduledEvent;
int hashCode2 = (i7 + (guildScheduledEvent != null ? guildScheduledEvent.hashCode() : 0)) * 31;
Channel channel = this.channel;
int hashCode3 = (hashCode2 + (channel != null ? channel.hashCode() : 0)) * 31;
Guild guild = this.guild;
int hashCode4 = (hashCode3 + (guild != null ? guild.hashCode() : 0)) * 31;
Long l = this.selectedVoiceChannelId;
if (l != null) {
i = l.hashCode();
}
return hashCode4 + i;
}
public final boolean isInGuild() {
return this.isInGuild;
}
public final boolean isRsvped() {
return this.isRsvped;
}
public String toString() {
StringBuilder P = a.P("Model(invite=");
P.append(this.invite);
P.append(", isInGuild=");
P.append(this.isInGuild);
P.append(", isRsvped=");
P.append(this.isRsvped);
P.append(", guildScheduledEvent=");
P.append(this.guildScheduledEvent);
P.append(", channel=");
P.append(this.channel);
P.append(", guild=");
P.append(this.guild);
P.append(", selectedVoiceChannelId=");
return a.F(P, this.selectedVoiceChannelId, ")");
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetChatListAdapterItemGuildScheduledEventInvite(WidgetChatListAdapter widgetChatListAdapter, StoreGuildScheduledEvents storeGuildScheduledEvents) {
super(R.layout.widget_chat_list_adapter_item_guild_scheduled_event_invite, widgetChatListAdapter);
m.checkNotNullParameter(widgetChatListAdapter, "adapter");
m.checkNotNullParameter(storeGuildScheduledEvents, "guildScheduledEventStore");
this.guildScheduledEventStore = storeGuildScheduledEvents;
View view = this.itemView;
Objects.requireNonNull(view, "rootView");
GuildScheduledEventItemView guildScheduledEventItemView = (GuildScheduledEventItemView) view;
WidgetChatListAdapterItemGuildScheduledEventInviteBinding widgetChatListAdapterItemGuildScheduledEventInviteBinding = new WidgetChatListAdapterItemGuildScheduledEventInviteBinding(guildScheduledEventItemView, guildScheduledEventItemView);
m.checkNotNullExpressionValue(widgetChatListAdapterItemGuildScheduledEventInviteBinding, "WidgetChatListAdapterIte…iteBinding.bind(itemView)");
this.binding = widgetChatListAdapterItemGuildScheduledEventInviteBinding;
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ WidgetChatListAdapterItemGuildScheduledEventInvite(WidgetChatListAdapter widgetChatListAdapter, StoreGuildScheduledEvents storeGuildScheduledEvents, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(widgetChatListAdapter, (i & 2) != 0 ? StoreStream.Companion.getGuildScheduledEvents() : storeGuildScheduledEvents);
}
public static final /* synthetic */ void access$configureUI(WidgetChatListAdapterItemGuildScheduledEventInvite widgetChatListAdapterItemGuildScheduledEventInvite, Model model) {
widgetChatListAdapterItemGuildScheduledEventInvite.configureUI(model);
}
public static final /* synthetic */ WidgetChatListAdapter access$getAdapter$p(WidgetChatListAdapterItemGuildScheduledEventInvite widgetChatListAdapterItemGuildScheduledEventInvite) {
return (WidgetChatListAdapter) widgetChatListAdapterItemGuildScheduledEventInvite.adapter;
}
public static final /* synthetic */ StoreGuildScheduledEvents access$getGuildScheduledEventStore$p(WidgetChatListAdapterItemGuildScheduledEventInvite widgetChatListAdapterItemGuildScheduledEventInvite) {
return widgetChatListAdapterItemGuildScheduledEventInvite.guildScheduledEventStore;
}
public static final /* synthetic */ Job access$getInviteJoinJob$p(WidgetChatListAdapterItemGuildScheduledEventInvite widgetChatListAdapterItemGuildScheduledEventInvite) {
return widgetChatListAdapterItemGuildScheduledEventInvite.inviteJoinJob;
}
public static final /* synthetic */ Subscription access$getSubscription$p(WidgetChatListAdapterItemGuildScheduledEventInvite widgetChatListAdapterItemGuildScheduledEventInvite) {
return widgetChatListAdapterItemGuildScheduledEventInvite.subscription;
}
public static final /* synthetic */ void access$setInviteJoinJob$p(WidgetChatListAdapterItemGuildScheduledEventInvite widgetChatListAdapterItemGuildScheduledEventInvite, Job job) {
widgetChatListAdapterItemGuildScheduledEventInvite.inviteJoinJob = job;
}
public static final /* synthetic */ void access$setSubscription$p(WidgetChatListAdapterItemGuildScheduledEventInvite widgetChatListAdapterItemGuildScheduledEventInvite, Subscription subscription) {
widgetChatListAdapterItemGuildScheduledEventInvite.subscription = subscription;
}
private final void configureUI(Model model) {
GuildScheduledEventItemView guildScheduledEventItemView = this.binding.b;
m.checkNotNullExpressionValue(guildScheduledEventItemView, "binding.guildScheduledEventInviteContainer");
WidgetChatListAdapterItemGuildScheduledEventInvite$configureUI$2 widgetChatListAdapterItemGuildScheduledEventInvite$configureUI$2 = null;
guildScheduledEventItemView.setBackground(null);
GuildScheduledEventItemView guildScheduledEventItemView2 = this.binding.b;
GuildScheduledEvent guildScheduledEvent = model.getGuildScheduledEvent();
Channel channel = model.getChannel();
Guild guild = model.getGuild();
boolean isInGuild = model.isInGuild();
boolean isRsvped = model.isRsvped();
Long b = model.getGuildScheduledEvent().b();
boolean z2 = false;
if (b != null) {
long longValue = b.longValue();
Long selectedVoiceChannelId = model.getSelectedVoiceChannelId();
if (selectedVoiceChannelId != null && longValue == selectedVoiceChannelId.longValue()) {
z2 = true;
}
}
if (model.isInGuild()) {
widgetChatListAdapterItemGuildScheduledEventInvite$configureUI$2 = new WidgetChatListAdapterItemGuildScheduledEventInvite$configureUI$2(this, model);
}
guildScheduledEventItemView2.configureInChatList(guildScheduledEvent, channel, guild, isInGuild, isRsvped, z2, widgetChatListAdapterItemGuildScheduledEventInvite$configureUI$2, new WidgetChatListAdapterItemGuildScheduledEventInvite$configureUI$3(this, model), new WidgetChatListAdapterItemGuildScheduledEventInvite$configureUI$4(this, model), new WidgetChatListAdapterItemGuildScheduledEventInvite$configureUI$5(this, model));
}
@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);
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui(Model.Companion.observe$default(Model.Companion, (GuildScheduledEventInviteEntry) chatListEntry, null, null, null, null, null, 62, null)), WidgetChatListAdapterItemGuildScheduledEventInvite.class, (Context) null, new WidgetChatListAdapterItemGuildScheduledEventInvite$onConfigure$2(this), (Function1) null, (Function0) null, (Function0) null, new WidgetChatListAdapterItemGuildScheduledEventInvite$onConfigure$1(this), 58, (Object) null);
}
}