2021-08-20 05:39:29 +00:00
|
|
|
package com.discord.widgets.guildscheduledevent;
|
|
|
|
|
|
|
|
import androidx.annotation.DrawableRes;
|
|
|
|
import c.d.b.a.a;
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.z.d.m;
|
2021-08-20 05:39:29 +00:00
|
|
|
import com.discord.R;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventEntityMetadata;
|
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventEntityType;
|
2021-10-08 22:11:56 +00:00
|
|
|
import com.discord.models.domain.ModelAuditLogEntry;
|
2021-08-20 05:39:29 +00:00
|
|
|
import kotlin.NoWhenBranchMatchedException;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
/* compiled from: GuildScheduledEventLocationInfo.kt */
|
|
|
|
public abstract class GuildScheduledEventLocationInfo {
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
|
|
|
|
/* compiled from: GuildScheduledEventLocationInfo.kt */
|
|
|
|
public static final class ChannelLocation extends GuildScheduledEventLocationInfo {
|
|
|
|
private final Channel channel;
|
|
|
|
|
|
|
|
public ChannelLocation(Channel channel) {
|
|
|
|
super(null);
|
|
|
|
this.channel = channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ ChannelLocation copy$default(ChannelLocation channelLocation, Channel channel, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
channel = channelLocation.channel;
|
|
|
|
}
|
|
|
|
return channelLocation.copy(channel);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Channel component1() {
|
|
|
|
return this.channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final ChannelLocation copy(Channel channel) {
|
|
|
|
return new ChannelLocation(channel);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this != obj) {
|
|
|
|
return (obj instanceof ChannelLocation) && m.areEqual(this.channel, ((ChannelLocation) obj).channel);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Channel getChannel() {
|
|
|
|
return this.channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
Channel channel = this.channel;
|
|
|
|
if (channel != null) {
|
|
|
|
return channel.hashCode();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-10-09 06:29:02 +00:00
|
|
|
StringBuilder O = a.O("ChannelLocation(channel=");
|
|
|
|
O.append(this.channel);
|
|
|
|
O.append(")");
|
|
|
|
return O.toString();
|
2021-08-20 05:39:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildScheduledEventLocationInfo.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEventLocationInfo buildLocationInfo(GuildScheduledEvent guildScheduledEvent, Channel channel) {
|
|
|
|
String str;
|
|
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
2021-08-25 07:02:36 +00:00
|
|
|
if (guildScheduledEvent.e() != GuildScheduledEventEntityType.EXTERNAL) {
|
|
|
|
return new ChannelLocation(channel);
|
2021-08-20 05:39:29 +00:00
|
|
|
}
|
2021-08-25 07:02:36 +00:00
|
|
|
GuildScheduledEventEntityMetadata d = guildScheduledEvent.d();
|
|
|
|
if (d == null || (str = d.a()) == null) {
|
|
|
|
str = "";
|
|
|
|
}
|
|
|
|
return new ExternalLocation(str);
|
2021-08-20 05:39:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEventLocationInfo buildLocationInfo(GuildScheduledEventModel guildScheduledEventModel, Channel channel) {
|
|
|
|
String str;
|
|
|
|
m.checkNotNullParameter(guildScheduledEventModel, "guildScheduledEventModel");
|
2021-08-25 07:02:36 +00:00
|
|
|
if (guildScheduledEventModel.getEntityType() != GuildScheduledEventEntityType.EXTERNAL) {
|
|
|
|
return new ChannelLocation(channel);
|
2021-08-20 05:39:29 +00:00
|
|
|
}
|
2021-08-25 07:02:36 +00:00
|
|
|
GuildScheduledEventEntityMetadata entityMetadata = guildScheduledEventModel.getEntityMetadata();
|
|
|
|
if (entityMetadata == null || (str = entityMetadata.a()) == null) {
|
|
|
|
str = "";
|
|
|
|
}
|
|
|
|
return new ExternalLocation(str);
|
2021-08-20 05:39:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildScheduledEventLocationInfo.kt */
|
|
|
|
public static final class ExternalLocation extends GuildScheduledEventLocationInfo {
|
|
|
|
private final String location;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public ExternalLocation(String str) {
|
|
|
|
super(null);
|
2021-10-08 22:11:56 +00:00
|
|
|
m.checkNotNullParameter(str, ModelAuditLogEntry.CHANGE_KEY_LOCATION);
|
2021-08-20 05:39:29 +00:00
|
|
|
this.location = str;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ ExternalLocation copy$default(ExternalLocation externalLocation, String str, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
str = externalLocation.location;
|
|
|
|
}
|
|
|
|
return externalLocation.copy(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String component1() {
|
|
|
|
return this.location;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final ExternalLocation copy(String str) {
|
2021-10-08 22:11:56 +00:00
|
|
|
m.checkNotNullParameter(str, ModelAuditLogEntry.CHANGE_KEY_LOCATION);
|
2021-08-20 05:39:29 +00:00
|
|
|
return new ExternalLocation(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this != obj) {
|
|
|
|
return (obj instanceof ExternalLocation) && m.areEqual(this.location, ((ExternalLocation) obj).location);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String getLocation() {
|
|
|
|
return this.location;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
String str = this.location;
|
|
|
|
if (str != null) {
|
|
|
|
return str.hashCode();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-10-09 06:29:02 +00:00
|
|
|
return a.G(a.O("ExternalLocation(location="), this.location, ")");
|
2021-08-20 05:39:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private GuildScheduledEventLocationInfo() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ GuildScheduledEventLocationInfo(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DrawableRes
|
|
|
|
private final int getChannelIcon(Channel channel) {
|
2021-08-25 07:02:36 +00:00
|
|
|
Integer valueOf = channel != null ? Integer.valueOf(channel.A()) : null;
|
|
|
|
return ((valueOf != null && valueOf.intValue() == 2) || valueOf == null || valueOf.intValue() != 13) ? R.drawable.ic_channel_voice : R.drawable.ic_stage_20dp;
|
2021-08-20 05:39:29 +00:00
|
|
|
}
|
|
|
|
|
2021-09-27 20:31:35 +00:00
|
|
|
@DrawableRes
|
|
|
|
private final int getChannelIconSmall(Channel channel) {
|
|
|
|
Integer valueOf = channel != null ? Integer.valueOf(channel.A()) : null;
|
|
|
|
return ((valueOf != null && valueOf.intValue() == 2) || valueOf == null || valueOf.intValue() != 13) ? R.drawable.ic_channel_voice_16dp : R.drawable.ic_channel_stage_16dp;
|
|
|
|
}
|
|
|
|
|
2021-08-20 05:39:29 +00:00
|
|
|
@DrawableRes
|
|
|
|
public final int getLocationIcon() {
|
|
|
|
if (this instanceof ChannelLocation) {
|
|
|
|
return getChannelIcon(((ChannelLocation) this).getChannel());
|
|
|
|
}
|
|
|
|
if (this instanceof ExternalLocation) {
|
|
|
|
return R.drawable.ic_location_24dp;
|
|
|
|
}
|
|
|
|
throw new NoWhenBranchMatchedException();
|
|
|
|
}
|
|
|
|
|
2021-09-27 20:31:35 +00:00
|
|
|
@DrawableRes
|
|
|
|
public final int getLocationIconSmall() {
|
|
|
|
if (this instanceof ChannelLocation) {
|
|
|
|
return getChannelIconSmall(((ChannelLocation) this).getChannel());
|
|
|
|
}
|
|
|
|
if (this instanceof ExternalLocation) {
|
|
|
|
return R.drawable.ic_location_16dp;
|
|
|
|
}
|
|
|
|
throw new NoWhenBranchMatchedException();
|
|
|
|
}
|
|
|
|
|
2021-08-20 05:39:29 +00:00
|
|
|
public final String getLocationName() {
|
2021-08-25 07:02:36 +00:00
|
|
|
String m;
|
2021-08-20 05:39:29 +00:00
|
|
|
if (this instanceof ChannelLocation) {
|
2021-08-25 07:02:36 +00:00
|
|
|
Channel channel = ((ChannelLocation) this).getChannel();
|
|
|
|
return (channel == null || (m = channel.m()) == null) ? "" : m;
|
2021-08-20 05:39:29 +00:00
|
|
|
} else if (this instanceof ExternalLocation) {
|
|
|
|
return ((ExternalLocation) this).getLocation();
|
|
|
|
} else {
|
|
|
|
throw new NoWhenBranchMatchedException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|