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

335 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 c0.z.d.m;
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.StorePermissions;
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 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 boolean canConnect;
private final boolean canShare;
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, StorePermissions storePermissions, int i, Object obj) {
return companion.observe(guildScheduledEventInviteEntry, (i & 2) != 0 ? StoreStream.Companion.getGuilds() : storeGuilds, (i & 4) != 0 ? StoreStream.Companion.getUsers() : storeUser, (i & 8) != 0 ? StoreStream.Companion.getChannels() : storeChannels, (i & 16) != 0 ? StoreStream.Companion.getGuildScheduledEvents() : storeGuildScheduledEvents, (i & 32) != 0 ? StoreStream.Companion.getVoiceChannelSelected() : storeVoiceChannelSelected, (i & 64) != 0 ? StoreStream.Companion.getPermissions() : storePermissions);
}
public final Observable<Model> observe(GuildScheduledEventInviteEntry guildScheduledEventInviteEntry, StoreGuilds storeGuilds, StoreUser storeUser, StoreChannels storeChannels, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreVoiceChannelSelected storeVoiceChannelSelected, StorePermissions storePermissions) {
m.checkNotNullParameter(guildScheduledEventInviteEntry, "item");
m.checkNotNullParameter(storeGuilds, "guildStore");
m.checkNotNullParameter(storeUser, "userStore");
m.checkNotNullParameter(storeChannels, "channelStore");
m.checkNotNullParameter(storeGuildScheduledEvents, "guildScheduledEventStore");
m.checkNotNullParameter(storeVoiceChannelSelected, "voiceChannelSelectedStore");
m.checkNotNullParameter(storePermissions, "permissionStore");
return ObservationDeck.connectRx$default(ObservationDeckProvider.get(), new ObservationDeck.UpdateSource[]{storeGuilds, storeUser, storeGuildScheduledEvents, storeVoiceChannelSelected, storePermissions}, false, null, null, new WidgetChatListAdapterItemGuildScheduledEventInvite$Model$Companion$observe$1(guildScheduledEventInviteEntry, storeGuilds, storeUser, storeGuildScheduledEvents, storeChannels, storeVoiceChannelSelected, storePermissions), 14, null);
}
}
public Model(ModelInvite modelInvite, boolean z2, boolean z3, GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, Long l, boolean z4, boolean z5) {
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;
this.canConnect = z4;
this.canShare = z5;
}
public static /* synthetic */ Model copy$default(Model model, ModelInvite modelInvite, boolean z2, boolean z3, GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, Long l, boolean z4, boolean z5, int i, Object obj) {
return model.copy((i & 1) != 0 ? model.invite : modelInvite, (i & 2) != 0 ? model.isInGuild : z2, (i & 4) != 0 ? model.isRsvped : z3, (i & 8) != 0 ? model.guildScheduledEvent : guildScheduledEvent, (i & 16) != 0 ? model.channel : channel, (i & 32) != 0 ? model.guild : guild, (i & 64) != 0 ? model.selectedVoiceChannelId : l, (i & 128) != 0 ? model.canConnect : z4, (i & 256) != 0 ? model.canShare : z5);
}
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 boolean component8() {
return this.canConnect;
}
public final boolean component9() {
return this.canShare;
}
public final Model copy(ModelInvite modelInvite, boolean z2, boolean z3, GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, Long l, boolean z4, boolean z5) {
m.checkNotNullParameter(modelInvite, "invite");
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
return new Model(modelInvite, z2, z3, guildScheduledEvent, channel, guild, l, z4, z5);
}
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) && this.canConnect == model.canConnect && this.canShare == model.canShare;
}
public final boolean getCanConnect() {
return this.canConnect;
}
public final boolean getCanShare() {
return this.canShare;
}
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) {
z3 = true;
}
int i7 = z3 ? 1 : 0;
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = (i6 + i7) * 31;
GuildScheduledEvent guildScheduledEvent = this.guildScheduledEvent;
int hashCode2 = (i10 + (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();
}
int i11 = (hashCode4 + i) * 31;
boolean z4 = this.canConnect;
if (z4) {
z4 = true;
}
int i12 = z4 ? 1 : 0;
int i13 = z4 ? 1 : 0;
int i14 = z4 ? 1 : 0;
int i15 = (i11 + i12) * 31;
boolean z5 = this.canShare;
if (!z5) {
i2 = z5 ? 1 : 0;
}
return i15 + i2;
}
public final boolean isInGuild() {
return this.isInGuild;
}
public final boolean isRsvped() {
return this.isRsvped;
}
public String toString() {
StringBuilder O = a.O("Model(invite=");
O.append(this.invite);
O.append(", isInGuild=");
O.append(this.isInGuild);
O.append(", isRsvped=");
O.append(this.isRsvped);
O.append(", guildScheduledEvent=");
O.append(this.guildScheduledEvent);
O.append(", channel=");
O.append(this.channel);
O.append(", guild=");
O.append(this.guild);
O.append(", selectedVoiceChannelId=");
O.append(this.selectedVoiceChannelId);
O.append(", canConnect=");
O.append(this.canConnect);
O.append(", canShare=");
return a.K(O, this.canShare, ")");
}
}
/* 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");
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;
}
}
guildScheduledEventItemView2.configureInChatList(guildScheduledEvent, channel, guild, isInGuild, isRsvped, z2, model.getCanConnect(), model.getCanShare(), new WidgetChatListAdapterItemGuildScheduledEventInvite$configureUI$2(this, model), 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, null, 126, null)), WidgetChatListAdapterItemGuildScheduledEventInvite.class, (Context) null, new WidgetChatListAdapterItemGuildScheduledEventInvite$onConfigure$2(this), (Function1) null, (Function0) null, (Function0) null, new WidgetChatListAdapterItemGuildScheduledEventInvite$onConfigure$1(this), 58, (Object) null);
}
}