discord-jadx/app/src/main/java/com/discord/utilities/fcm/NotificationData.java

1191 lines
56 KiB
Java

package com.discord.utilities.fcm;
import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.Html;
import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;
import androidx.core.app.Person;
import androidx.core.app.RemoteInput;
import androidx.core.graphics.drawable.IconCompat;
import c.a.k.b;
import c.d.b.a.a;
import com.airbnb.lottie.parser.AnimatableValueParser;
import com.discord.R;
import com.discord.api.application.Application;
import com.discord.api.channel.Channel;
import com.discord.api.guildmember.GuildMember;
import com.discord.api.guildscheduledevent.GuildScheduledEventEntityType;
import com.discord.api.message.Message;
import com.discord.api.message.activity.MessageActivity;
import com.discord.api.message.activity.MessageActivityType;
import com.discord.api.sticker.Sticker;
import com.discord.api.user.User;
import com.discord.app.AppActivity;
import com.discord.models.domain.ModelAuditLogEntry;
import com.discord.nullserializable.NullSerializable;
import com.discord.utilities.SnowflakeUtils;
import com.discord.utilities.extensions.PendingIntentExtensionsKt;
import com.discord.utilities.icon.IconUtils;
import com.discord.utilities.intent.IntentUtils;
import com.discord.utilities.media.AppSound;
import com.discord.utilities.message.MessageUtils;
import com.discord.utilities.stickers.StickerUtils;
import com.discord.utilities.time.Clock;
import com.discord.widgets.chat.input.MentionUtilsKt;
import d0.d0.f;
import d0.g0.s;
import d0.g0.t;
import d0.g0.w;
import d0.t.g0;
import d0.t.n;
import d0.t.o;
import d0.t.u;
import d0.z.d.m;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Random;
import java.util.Set;
import kotlin.Pair;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: NotificationData.kt */
public final class NotificationData {
private static final int ACTIVITY_TYPE_PLAYING = 0;
private static final int ACTIVITY_TYPE_STREAMING = 1;
private static final String ANALYTICS_ACTIVITY_NAME = "activity_name";
private static final String ANALYTICS_ACTIVITY_TYPE = "activity_type";
private static final String ANALYTICS_CHANNEL_ID = "channel_id";
private static final String ANALYTICS_CHANNEL_TYPE = "channel_type";
private static final String ANALYTICS_GUILD_ID = "guild_id";
private static final String ANALYTICS_MESSAGE_ID = "message_id";
private static final String ANALYTICS_MESSAGE_TYPE = "message_type";
private static final String ANALYTICS_NOTIF_IN_APP = "notif_in_app";
private static final String ANALYTICS_NOTIF_TYPE = "notif_type";
private static final String ANALYTICS_NOTIF_USER_ID = "notif_user_id";
private static final String ANALYTICS_REL_TYPE = "rel_type";
public static final Companion Companion = new Companion(null);
private static final String GROUP_KEY_PREFIX = "GROUP_";
private static final int MSG_MUTE_MIN_COUNT = 2;
public static final String REPLYING_TO_UNTRANSLATED = "replying to";
public static final String TYPE_ACTIVITY_START = "ACTIVITY_START";
public static final String TYPE_APPLICATION_LIBRARY_INSTALL_COMPLETE = "APPLICATION_LIBRARY_INSTALL_COMPLETE";
public static final String TYPE_CALL_RING = "CALL_RING";
public static final String TYPE_GUILD_SCHEDULED_EVENT_UPDATE = "GUILD_SCHEDULED_EVENT_UPDATE";
public static final String TYPE_MESSAGE_CREATE = "MESSAGE_CREATE";
public static final String TYPE_RELATIONSHIP_ADD = "RELATIONSHIP_ADD";
public static final String TYPE_STAGE_INSTANCE_CREATE = "STAGE_INSTANCE_CREATE";
public static final int UNSET_INT = -1;
public static final long UNSET_LONG = -1;
private final List<Long> ackChannelIds;
private final String activityName;
private final int activityType;
private final String applicationIcon;
private final long applicationId;
private final String applicationName;
private final Channel channel;
private final String guildIcon;
private final long guildId;
private final String guildMemberAvatar;
private final String guildName;
private final GuildScheduledEventEntityType guildScheduledEventEntityType;
private final boolean isGroupConversation;
private final MessageActivityType messageActivityType;
private final String messageApplicationName;
private final String messageContent;
private final long messageId;
private final int messageType;
private final int relationshipType;
private final String stageInstanceTopic;
private final Sticker sticker;
private final String subtitle;
private final String type;
private final String userAvatar;
private final Integer userDiscriminator;
private final long userId;
private final String userUsername;
/* compiled from: NotificationData.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public static final /* synthetic */ List access$parseAckChannelIds(Companion companion, String str) {
return companion.parseAckChannelIds(str);
}
private final void copyIntIntoMap(Intent intent, Map<String, Object> map, String str) {
int i = -1;
if (intent != null) {
i = intent.getIntExtra(str, -1);
}
if (i >= 0) {
map.put(str, Integer.valueOf(i));
}
}
private final void copyLongIntoMap(Intent intent, Map<String, Object> map, String str) {
long j = -1;
if (intent != null) {
j = intent.getLongExtra(str, -1);
}
if (j >= 0) {
map.put(str, Long.valueOf(j));
}
}
private final void copyStringIntoMap(Intent intent, Map<String, Object> map, String str) {
String stringExtra;
if (intent != null && (stringExtra = intent.getStringExtra(str)) != null) {
m.checkNotNullExpressionValue(stringExtra, "this?.getStringExtra(key) ?: return");
if (!(stringExtra.length() == 0)) {
map.put(str, stringExtra);
}
}
}
private final List<Long> parseAckChannelIds(String str) {
if (str == null) {
str = "";
}
List split$default = w.split$default((CharSequence) str, new String[]{","}, false, 0, 6, (Object) null);
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(split$default, 10));
Iterator it = split$default.iterator();
while (true) {
long j = -1;
if (!it.hasNext()) {
break;
}
Long longOrNull = s.toLongOrNull((String) it.next());
if (longOrNull != null) {
j = longOrNull.longValue();
}
arrayList.add(Long.valueOf(j));
}
ArrayList arrayList2 = new ArrayList();
for (Object obj : arrayList) {
if (((Number) obj).longValue() != -1) {
arrayList2.add(obj);
}
}
return arrayList2;
}
public final Map<String, Object> buildTrackingData(Intent intent) {
String stringExtra;
HashMap hashMap = new HashMap();
copyStringIntoMap(intent, hashMap, NotificationData.ANALYTICS_NOTIF_TYPE);
copyLongIntoMap(intent, hashMap, NotificationData.ANALYTICS_NOTIF_USER_ID);
copyLongIntoMap(intent, hashMap, NotificationData.ANALYTICS_MESSAGE_ID);
copyLongIntoMap(intent, hashMap, "guild_id");
copyLongIntoMap(intent, hashMap, "channel_id");
copyIntIntoMap(intent, hashMap, NotificationData.ANALYTICS_MESSAGE_TYPE);
copyIntIntoMap(intent, hashMap, NotificationData.ANALYTICS_CHANNEL_TYPE);
copyIntIntoMap(intent, hashMap, NotificationData.ANALYTICS_REL_TYPE);
copyIntIntoMap(intent, hashMap, NotificationData.ANALYTICS_ACTIVITY_TYPE);
copyStringIntoMap(intent, hashMap, NotificationData.ANALYTICS_ACTIVITY_NAME);
if (!(intent == null || (stringExtra = intent.getStringExtra("com.discord.intent.ORIGIN_SOURCE")) == null)) {
hashMap.put(NotificationData.ANALYTICS_NOTIF_IN_APP, Boolean.valueOf(t.equals(stringExtra, "com.discord.intent.ORIGIN_NOTIF_INAPP", true)));
}
return hashMap;
}
}
/* compiled from: NotificationData.kt */
public static final class DisplayPayload {
private NotificationData data;
private final LinkedHashMap<Long, NotificationData> extras;
/* renamed from: id reason: collision with root package name */
private final int f2151id;
private boolean ignoreNextClearForAck;
public DisplayPayload() {
this(new NotificationData());
}
public DisplayPayload(NotificationData notificationData) {
m.checkNotNullParameter(notificationData, "data");
this.data = notificationData;
this.f2151id = new Random().nextInt(Integer.MAX_VALUE);
this.extras = new LinkedHashMap<>();
}
private final void trimExtrasWhenOversized(int i) {
if (this.extras.size() >= i) {
Set<Map.Entry<Long, NotificationData>> entrySet = this.extras.entrySet();
m.checkNotNullExpressionValue(entrySet, "extras\n .entries");
List<Map.Entry> drop = u.drop(entrySet, this.extras.size() - (i / 2));
LinkedHashMap linkedHashMap = new LinkedHashMap(f.coerceAtLeast(g0.mapCapacity(o.collectionSizeOrDefault(drop, 10)), 16));
for (Map.Entry entry : drop) {
linkedHashMap.put((Long) entry.getKey(), (NotificationData) entry.getValue());
}
this.extras.clear();
this.extras.putAll(linkedHashMap);
}
}
public static /* synthetic */ void update$default(DisplayPayload displayPayload, NotificationData notificationData, int i, int i2, Object obj) {
if ((i2 & 2) != 0) {
i = 20;
}
displayPayload.update(notificationData, i);
}
public final NotificationData getData() {
return this.data;
}
public final synchronized List<NotificationData> getExtras() {
Collection<NotificationData> values;
values = this.extras.values();
m.checkNotNullExpressionValue(values, "extras.values");
return u.toList(values);
}
public final int getId() {
return this.f2151id;
}
public final boolean getIgnoreNextClearForAck() {
return this.ignoreNextClearForAck;
}
public final void setData(NotificationData notificationData) {
m.checkNotNullParameter(notificationData, "<set-?>");
this.data = notificationData;
}
public final void setIgnoreNextClearForAck(boolean z2) {
this.ignoreNextClearForAck = z2;
}
public final synchronized void update(NotificationData notificationData, int i) {
m.checkNotNullParameter(notificationData, "data");
this.data = notificationData;
trimExtrasWhenOversized(i);
if (notificationData.getShouldGroup()) {
this.extras.put(Long.valueOf(notificationData.getMessageId()), notificationData);
} else {
this.extras.clear();
}
}
}
public final /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
public static final /* synthetic */ int[] $EnumSwitchMapping$1;
public static final /* synthetic */ int[] $EnumSwitchMapping$2;
public static final /* synthetic */ int[] $EnumSwitchMapping$3;
public static final /* synthetic */ int[] $EnumSwitchMapping$4;
static {
GuildScheduledEventEntityType.values();
int[] iArr = new int[3];
$EnumSwitchMapping$0 = iArr;
GuildScheduledEventEntityType guildScheduledEventEntityType = GuildScheduledEventEntityType.STAGE_INSTANCE;
iArr[guildScheduledEventEntityType.ordinal()] = 1;
GuildScheduledEventEntityType.values();
int[] iArr2 = new int[3];
$EnumSwitchMapping$1 = iArr2;
iArr2[guildScheduledEventEntityType.ordinal()] = 1;
GuildScheduledEventEntityType.values();
int[] iArr3 = new int[3];
$EnumSwitchMapping$2 = iArr3;
iArr3[guildScheduledEventEntityType.ordinal()] = 1;
GuildScheduledEventEntityType.values();
int[] iArr4 = new int[3];
$EnumSwitchMapping$3 = iArr4;
iArr4[guildScheduledEventEntityType.ordinal()] = 1;
GuildScheduledEventEntityType.values();
int[] iArr5 = new int[3];
$EnumSwitchMapping$4 = iArr5;
iArr5[guildScheduledEventEntityType.ordinal()] = 1;
}
}
public NotificationData() {
this(new HashMap());
}
public NotificationData(String str, long j, MessageActivityType messageActivityType, String str2, int i, String str3, Channel channel, List<Long> list, long j2, String str4, Integer num, String str5, String str6, int i2, long j3, String str7, String str8, int i3, String str9, long j4, String str10, String str11, Sticker sticker, String str12, String str13, GuildScheduledEventEntityType guildScheduledEventEntityType) {
m.checkNotNullParameter(str, "type");
m.checkNotNullParameter(channel, "channel");
m.checkNotNullParameter(list, "ackChannelIds");
this.type = str;
this.messageId = j;
this.messageActivityType = messageActivityType;
this.messageApplicationName = str2;
this.messageType = i;
this.messageContent = str3;
this.channel = channel;
this.ackChannelIds = list;
this.userId = j2;
this.userUsername = str4;
this.userDiscriminator = num;
this.userAvatar = str5;
this.guildMemberAvatar = str6;
this.relationshipType = i2;
this.guildName = str7;
this.guildIcon = str8;
this.activityType = i3;
this.activityName = str9;
this.applicationId = j4;
this.applicationName = str10;
this.applicationIcon = str11;
this.sticker = sticker;
this.subtitle = str12;
this.stageInstanceTopic = str13;
this.guildScheduledEventEntityType = guildScheduledEventEntityType;
Long valueOf = Long.valueOf(j3);
boolean z2 = false;
long j5 = -1;
valueOf = (valueOf.longValue() > -1 ? 1 : (valueOf.longValue() == -1 ? 0 : -1)) == 0 ? null : valueOf;
if (valueOf != null) {
j5 = valueOf.longValue();
} else {
int A = channel.A();
if (A == 1 || A == 3) {
j5 = 0;
}
}
this.guildId = j5;
if (m.areEqual(str, TYPE_MESSAGE_CREATE) && (channel.A() == 0 || channel.A() == 3 || channel.A() == 10 || channel.A() == 11 || channel.A() == 12)) {
z2 = true;
}
this.isGroupConversation = z2;
}
/* JADX WARNING: Illegal instructions before constructor call */
public NotificationData(Map<String, String> map) {
this(r1, r1, r6, r7, r8, r9, r49, r11, r12, r14, r15, r16, r17, r18, r19, r21, r22, r23, r24, r25, r27, r28, r29, r30, r31, r32);
GuildScheduledEventEntityType guildScheduledEventEntityType;
Integer intOrNull;
Long longOrNull;
Integer intOrNull2;
Long longOrNull2;
Integer intOrNull3;
Long longOrNull3;
Long longOrNull4;
Long longOrNull5;
Integer intOrNull4;
Integer intOrNull5;
Integer intOrNull6;
Long longOrNull6;
m.checkNotNullParameter(map, "data");
String str = map.get("type");
str = str == null ? "" : str;
String str2 = map.get(ANALYTICS_MESSAGE_ID);
long longValue = (str2 == null || (longOrNull6 = s.toLongOrNull(str2)) == null) ? -1 : longOrNull6.longValue();
String str3 = map.get("message_activity_type");
MessageActivityType a = (str3 == null || (intOrNull6 = s.toIntOrNull(str3)) == null) ? null : MessageActivityType.Companion.a(intOrNull6);
String str4 = map.get("message_application_name");
String str5 = map.get("message_type_");
int intValue = (str5 == null || (intOrNull5 = s.toIntOrNull(str5)) == null) ? -1 : intOrNull5.intValue();
String str6 = map.get("message_content");
String str7 = map.get(ANALYTICS_CHANNEL_TYPE);
int intValue2 = (str7 == null || (intOrNull4 = s.toIntOrNull(str7)) == null) ? -1 : intOrNull4.intValue();
String str8 = map.get("guild_id");
long longValue2 = (str8 == null || (longOrNull5 = s.toLongOrNull(str8)) == null) ? -1 : longOrNull5.longValue();
String str9 = map.get("channel_name");
String obj = str9 != null ? b.l(a.t("!!", str9, "!!"), new Object[0], null, 2).toString() : null;
String str10 = map.get("channel_id");
Channel channel = new Channel(null, intValue2, longValue2, obj, 0, (str10 == null || (longOrNull4 = s.toLongOrNull(str10)) == null) ? -1 : longOrNull4.longValue(), 0, null, null, 0, null, 0, 0, map.get("channel_icon"), 0, 0, null, false, 0, null, 0, null, map.get(ModelAuditLogEntry.CHANGE_KEY_REGION_OVERRIDE), null, null, null, null, null, null);
List access$parseAckChannelIds = Companion.access$parseAckChannelIds(Companion, map.get("channel_ids"));
String str11 = map.get("user_id");
long longValue3 = (str11 == null || (longOrNull3 = s.toLongOrNull(str11)) == null) ? -1 : longOrNull3.longValue();
String str12 = map.get("user_username");
String str13 = map.get("user_discriminator");
Integer intOrNull7 = str13 != null ? s.toIntOrNull(str13) : null;
String str14 = map.get("user_avatar");
String str15 = map.get("user_guild_avatar");
String str16 = map.get(ANALYTICS_REL_TYPE);
int intValue3 = (str16 == null || (intOrNull3 = s.toIntOrNull(str16)) == null) ? -1 : intOrNull3.intValue();
String str17 = map.get("guild_id");
long longValue4 = (str17 == null || (longOrNull2 = s.toLongOrNull(str17)) == null) ? -1 : longOrNull2.longValue();
String str18 = map.get("guild_name");
String str19 = map.get("guild_icon");
String str20 = map.get(ANALYTICS_ACTIVITY_TYPE);
int intValue4 = (str20 == null || (intOrNull2 = s.toIntOrNull(str20)) == null) ? -1 : intOrNull2.intValue();
String str21 = map.get(ANALYTICS_ACTIVITY_NAME);
String str22 = map.get(ModelAuditLogEntry.CHANGE_KEY_APPLICATION_ID);
long longValue5 = (str22 == null || (longOrNull = s.toLongOrNull(str22)) == null) ? -1 : longOrNull.longValue();
String str23 = map.get("application_name");
String str24 = map.get("application_icon");
Sticker parseFromMessageNotificationJson = StickerUtils.INSTANCE.parseFromMessageNotificationJson(map.get("message"));
String str25 = map.get("subtitle");
String str26 = map.get("stage_instance_topic");
String str27 = map.get("guild_scheduled_event_entity_type");
if (str27 == null || (intOrNull = s.toIntOrNull(str27)) == null) {
guildScheduledEventEntityType = null;
} else {
GuildScheduledEventEntityType.Companion companion = GuildScheduledEventEntityType.Companion;
int intValue5 = intOrNull.intValue();
Objects.requireNonNull(companion);
guildScheduledEventEntityType = intValue5 != 0 ? intValue5 != 1 ? GuildScheduledEventEntityType.UNKNOWN : GuildScheduledEventEntityType.STAGE_INSTANCE : GuildScheduledEventEntityType.NONE;
}
}
private final Intent addTrackingData(Intent intent) {
Intent putExtra = intent.putExtra(ANALYTICS_NOTIF_TYPE, this.type).putExtra(ANALYTICS_NOTIF_USER_ID, this.userId).putExtra(ANALYTICS_MESSAGE_ID, this.messageId).putExtra(ANALYTICS_MESSAGE_TYPE, this.messageType).putExtra("guild_id", this.guildId).putExtra("channel_id", this.channel.h()).putExtra(ANALYTICS_CHANNEL_TYPE, this.channel.A()).putExtra(ANALYTICS_REL_TYPE, this.relationshipType).putExtra(ANALYTICS_ACTIVITY_TYPE, this.activityType).putExtra(ANALYTICS_ACTIVITY_NAME, this.activityName);
m.checkNotNullExpressionValue(putExtra, "intent\n .putExtra…IVITY_NAME, activityName)");
return putExtra;
}
/* JADX WARNING: Code restructure failed: missing block: B:11:0x0042, code lost:
if (r0.equals(com.discord.utilities.fcm.NotificationData.TYPE_RELATIONSHIP_ADD) != false) goto L_0x0044;
*/
/* JADX WARNING: Code restructure failed: missing block: B:13:0x004a, code lost:
if (r8.channel.A() == 1) goto L_0x005c;
*/
/* JADX WARNING: Code restructure failed: missing block: B:28:?, code lost:
return com.discord.utilities.intent.IntentUtils.RouteBuilders.selectChannel$default(r8.channel.h(), r8.guildId, null, 4, null);
*/
/* JADX WARNING: Code restructure failed: missing block: B:29:?, code lost:
return com.discord.utilities.intent.IntentUtils.RouteBuilders.selectChannel$default(r8.channel.h(), 0, null, 4, null);
*/
/* JADX WARNING: Code restructure failed: missing block: B:3:0x0012, code lost:
if (r0.equals(com.discord.utilities.fcm.NotificationData.TYPE_MESSAGE_CREATE) != false) goto L_0x0044;
*/
private final Intent getContentIntentInternal() {
String str = this.type;
switch (str.hashCode()) {
case -1489275252:
if (str.equals(TYPE_GUILD_SCHEDULED_EVENT_UPDATE)) {
GuildScheduledEventEntityType guildScheduledEventEntityType = this.guildScheduledEventEntityType;
return (guildScheduledEventEntityType != null && guildScheduledEventEntityType.ordinal() == 1) ? IntentUtils.RouteBuilders.INSTANCE.connectVoice(this.channel.h()) : new Intent("android.intent.action.VIEW", IntentUtils.RouteBuilders.Uris.INSTANCE.getApp());
}
return IntentUtils.RouteBuilders.selectChannel$default(this.channel.h(), this.guildId, null, 4, null);
case -1327124998:
break;
case -1263316859:
if (str.equals(TYPE_STAGE_INSTANCE_CREATE)) {
return IntentUtils.RouteBuilders.INSTANCE.connectVoice(this.channel.h());
}
return IntentUtils.RouteBuilders.selectChannel$default(this.channel.h(), this.guildId, null, 4, null);
case 974015250:
if (str.equals(TYPE_ACTIVITY_START)) {
return IntentUtils.RouteBuilders.INSTANCE.selectDirectMessage(this.userId);
}
return IntentUtils.RouteBuilders.selectChannel$default(this.channel.h(), this.guildId, null, 4, null);
case 998188116:
break;
default:
return IntentUtils.RouteBuilders.selectChannel$default(this.channel.h(), this.guildId, null, 4, null);
}
}
private final String getIconUrlForChannel() {
int A = this.channel.A();
if (A != 0) {
if (A == 1) {
return getIconUrlForUser();
}
if (A != 5) {
switch (A) {
case 10:
case 11:
case 12:
break;
default:
return IconUtils.getForChannel$default(this.channel.h(), this.channel.g(), this.channel.A(), true, null, 16, null);
}
}
}
return IconUtils.getForGuild$default(Long.valueOf(this.guildId), this.guildIcon, "", false, null, 24, null);
}
private final String getIconUrlForGuildMember() {
return IconUtils.getForGuildMember$default(IconUtils.INSTANCE, this.guildMemberAvatar, this.guildId, this.userId, null, false, 24, null);
}
public final boolean canDisplayInApp() {
if (m.areEqual(this.type, TYPE_STAGE_INSTANCE_CREATE)) {
return true;
}
if (!m.areEqual(this.type, TYPE_GUILD_SCHEDULED_EVENT_UPDATE)) {
return this.channel.h() == -1;
}
GuildScheduledEventEntityType guildScheduledEventEntityType = this.guildScheduledEventEntityType;
return guildScheduledEventEntityType != null && guildScheduledEventEntityType.ordinal() == 1;
}
public final NotificationData copyForDirectReply(Message message) {
NullSerializable<String> a;
String a2;
String f;
String r;
m.checkNotNullParameter(message, "message");
long o = message.o();
MessageActivity a3 = message.a();
MessageActivityType b = a3 != null ? a3.b() : null;
Application b2 = message.b();
String g = b2 != null ? b2.g() : null;
Integer E = message.E();
m.checkNotNull(E);
int intValue = E.intValue();
String i = message.i();
Channel a4 = Channel.a(this.channel, null, 0, 0, null, 0, message.g(), 0, null, null, 0, null, 0, 0, null, 0, 0, null, false, 0, null, 0, null, null, null, null, null, null, null, null, 536870879);
List emptyList = n.emptyList();
User e = message.e();
long i2 = e != null ? e.i() : 0;
User e2 = message.e();
String str = (e2 == null || (r = e2.r()) == null) ? "" : r;
User e3 = message.e();
Integer intOrNull = (e3 == null || (f = e3.f()) == null) ? null : s.toIntOrNull(f);
User e4 = message.e();
String str2 = (e4 == null || (a = e4.a()) == null || (a2 = a.a()) == null) ? "" : a2;
GuildMember q = message.q();
String b3 = q != null ? q.b() : null;
long j = this.guildId;
String str3 = this.guildName;
String str4 = this.guildIcon;
List<Sticker> A = message.A();
return new NotificationData(TYPE_MESSAGE_CREATE, o, b, g, intValue, i, a4, emptyList, i2, str, intOrNull, str2, b3, -1, j, str3, str4, -1, null, -1, null, null, A != null ? (Sticker) u.firstOrNull((List<? extends Object>) A) : null, null, null, null);
}
public final List<Long> getAckChannelIds() {
return this.ackChannelIds;
}
@RequiresApi(24)
@SuppressLint({"UnspecifiedImmutableFlag"})
public final NotificationCompat.Action getCallAction(Context context, boolean z2) {
m.checkNotNullParameter(context, "ctx");
if (!m.areEqual(this.type, TYPE_CALL_RING)) {
return null;
}
PendingIntent broadcast = PendingIntent.getBroadcast(context, 0, addTrackingData(NotificationActions.Companion.callAction(context, this.channel.h(), this.messageId, z2)), PendingIntentExtensionsKt.immutablePendingIntentFlag$default(0, 1, null));
Pair pair = z2 ? d0.o.to(Integer.valueOf((int) R.string.join_call), Integer.valueOf((int) R.color.status_green_600)) : d0.o.to(Integer.valueOf((int) R.string.decline), Integer.valueOf((int) R.color.status_red_500));
int intValue = ((Number) pair.component1()).intValue();
int intValue2 = ((Number) pair.component2()).intValue();
StringBuilder L = a.L("**");
L.append(b.h(context, intValue, new Object[0], null, 4));
L.append("**");
return new NotificationCompat.Action.Builder(z2 ? R.drawable.ic_call_24dp : R.drawable.ic_call_disconnect_24dp, b.g(L.toString(), new Object[0], new NotificationData$getCallAction$coloredString$1(context, intValue2)), broadcast).build();
}
public final long getChannelId() {
return this.channel.h();
}
public final CharSequence getContent(Context context) {
GuildScheduledEventEntityType guildScheduledEventEntityType;
CharSequence charSequence;
m.checkNotNullParameter(context, "context");
String str = this.type;
switch (str.hashCode()) {
case -1489275252:
return (!str.equals(TYPE_GUILD_SCHEDULED_EVENT_UPDATE) || (guildScheduledEventEntityType = this.guildScheduledEventEntityType) == null || guildScheduledEventEntityType.ordinal() != 1) ? "" : b.h(context, R.string.guild_scheduled_event_stage_start_body, new Object[]{this.stageInstanceTopic, this.userUsername}, null, 4);
case -1327124998:
if (!str.equals(TYPE_RELATIONSHIP_ADD)) {
return "";
}
int i = this.relationshipType;
return i != 1 ? i != 3 ? "" : b.h(context, R.string.notification_pending_friend_request, new Object[0], null, 4) : b.h(context, R.string.notification_accepted_friend_request, new Object[0], null, 4);
case -1263316859:
return str.equals(TYPE_STAGE_INSTANCE_CREATE) ? b.h(context, R.string.stage_start_push_notification_body, new Object[]{this.userUsername, this.stageInstanceTopic}, null, 4) : "";
case -1237752112:
return str.equals(TYPE_APPLICATION_LIBRARY_INSTALL_COMPLETE) ? b.h(context, R.string.game_library_notification_game_installed_body, new Object[]{this.applicationName}, null, 4) : "";
case 974015250:
return (!str.equals(TYPE_ACTIVITY_START) || this.activityType != 0) ? "" : b.h(context, R.string.notification_body_start_game, new Object[]{this.userUsername, this.activityName}, null, 4);
case 998188116:
if (!str.equals(TYPE_MESSAGE_CREATE)) {
return "";
}
int A = this.channel.A();
if (A != 0) {
if (A == 1 || A == 3) {
if (this.messageActivityType == MessageActivityType.JOIN) {
return b.h(context, R.string.notification_message_create_dm_activity_join, new Object[]{this.userUsername, this.messageApplicationName}, null, 4);
}
Sticker sticker = this.sticker;
if (sticker != null) {
return b.h(context, R.string.sticker_notification_body, new Object[]{sticker.h()}, null, 4);
}
String str2 = this.messageContent;
if (str2 != null) {
charSequence = b.l(str2, new Object[0], null, 2);
return charSequence;
}
return null;
} else if (A != 5) {
switch (A) {
case 10:
case 11:
case 12:
break;
default:
return "";
}
}
}
if (this.messageType == 7) {
return b.h(context, MessageUtils.INSTANCE.getSystemMessageUserJoin(context, this.messageId), new Object[]{this.userUsername}, null, 4);
}
if (this.messageActivityType == MessageActivityType.JOIN) {
return b.h(context, R.string.notification_message_create_guild_activity_join, new Object[]{this.userUsername, this.messageApplicationName}, null, 4);
}
Sticker sticker2 = this.sticker;
if (sticker2 != null) {
return b.h(context, R.string.sticker_notification_body, new Object[]{sticker2.h()}, null, 4);
}
String str3 = this.messageContent;
if (str3 != null) {
charSequence = b.l(str3, new Object[0], null, 2);
return charSequence;
}
return null;
case 1770025841:
return str.equals(TYPE_CALL_RING) ? b.l(b.h(context, R.string.overlay_friend_calling, new Object[]{a.D(a.L("**"), this.userUsername, "**")}, null, 4), new Object[0], null, 2) : "";
default:
return "";
}
}
@SuppressLint({"UnspecifiedImmutableFlag"})
public final PendingIntent getContentIntent(Context context) {
m.checkNotNullParameter(context, "context");
Intent contentIntentInternal = getContentIntentInternal();
contentIntentInternal.putExtra("com.discord.intent.ORIGIN_SOURCE", "com.discord.intent.ORIGIN_NOTIF");
contentIntentInternal.setClass(context, AppActivity.Main.class);
PendingIntent activity = PendingIntent.getActivity(context, 0, addTrackingData(contentIntentInternal), PendingIntentExtensionsKt.immutablePendingIntentFlag(134217728));
m.checkNotNullExpressionValue(activity, "PendingIntent.getActivit…LAG_UPDATE_CURRENT)\n )");
return activity;
}
@SuppressLint({"UnspecifiedImmutableFlag"})
public final PendingIntent getContentIntentInApp(Context context) {
m.checkNotNullParameter(context, "context");
Intent contentIntentInternal = getContentIntentInternal();
contentIntentInternal.putExtra("com.discord.intent.ORIGIN_SOURCE", "com.discord.intent.ORIGIN_NOTIF_INAPP");
contentIntentInternal.setClass(context, AppActivity.Main.class);
PendingIntent activity = PendingIntent.getActivity(context, 0, addTrackingData(contentIntentInternal), PendingIntentExtensionsKt.immutablePendingIntentFlag(134217728));
m.checkNotNullExpressionValue(activity, "PendingIntent.getActivit…LAG_UPDATE_CURRENT)\n )");
return activity;
}
public final CharSequence getConversationTitle(Context context) {
m.checkNotNullParameter(context, "context");
String str = this.type;
if (str.hashCode() != 998188116 || !str.equals(TYPE_MESSAGE_CREATE)) {
return null;
}
int A = this.channel.A();
if (A != 0) {
if (A == 3) {
return AnimatableValueParser.A0(this.channel, context, false, 2);
}
if (A != 5) {
switch (A) {
case 10:
case 11:
case 12:
break;
default:
return null;
}
}
}
return b.l(this.guildName + " _" + AnimatableValueParser.A0(this.channel, context, false, 2) + '_', new Object[0], null, 2);
}
@SuppressLint({"UnspecifiedImmutableFlag"})
public final PendingIntent getDeleteIntent(Context context) {
m.checkNotNullParameter(context, "context");
PendingIntent broadcast = PendingIntent.getBroadcast(context, 0, NotificationActions.Companion.delete(context, this.channel.h()), PendingIntentExtensionsKt.immutablePendingIntentFlag(134217728));
m.checkNotNullExpressionValue(broadcast, "PendingIntent.getBroadca…LAG_UPDATE_CURRENT)\n )");
return broadcast;
}
@RequiresApi(24)
@SuppressLint({"UnspecifiedImmutableFlag"})
public final NotificationCompat.Action getDirectReplyAction(Context context, Set<Long> set) {
m.checkNotNullParameter(context, "ctx");
m.checkNotNullParameter(set, "deniedChannels");
if ((!m.areEqual(this.type, TYPE_MESSAGE_CREATE)) || set.contains(Long.valueOf(this.channel.h()))) {
return null;
}
RemoteInput build = new RemoteInput.Builder("discord_notif_text_input").setLabel(b.h(context, R.string.send_message, new Object[0], null, 4)).build();
m.checkNotNullExpressionValue(build, "RemoteInput.Builder(Inte…essage))\n .build()");
return new NotificationCompat.Action.Builder((int) R.drawable.ic_send_white_24dp, b.h(context, R.string.notification_reply, new Object[0], null, 4), PendingIntent.getBroadcast(context, (int) this.channel.h(), addTrackingData(NotificationActions.Companion.directReply(context, this.channel.h(), getTitle(context))), PendingIntentExtensionsKt.mutablePendingIntentFlag(134217728))).addRemoteInput(build).setAllowGeneratedReplies(true).build();
}
@SuppressLint({"UnspecifiedImmutableFlag"})
public final PendingIntent getFullScreenIntent(Context context) {
m.checkNotNullParameter(context, "context");
if (!m.areEqual(getNotificationCategory(), NotificationCompat.CATEGORY_CALL)) {
return null;
}
Intent intent = new Intent(context, AppActivity.IncomingCall.class);
intent.addFlags(268435456);
return PendingIntent.getActivity(context, 0, addTrackingData(intent), PendingIntentExtensionsKt.immutablePendingIntentFlag(134217728));
}
public final String getGroupKey() {
StringBuilder L = a.L(GROUP_KEY_PREFIX);
L.append(this.type);
return L.toString();
}
public final long getGuildId() {
return this.guildId;
}
/* JADX WARNING: Removed duplicated region for block: B:18:0x004c */
/* JADX WARNING: Removed duplicated region for block: B:27:? A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:32:? A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:35:? A[RETURN, SYNTHETIC] */
public final String getIconUrl() {
String str;
String str2 = this.type;
switch (str2.hashCode()) {
case -1489275252:
if (!str2.equals(TYPE_GUILD_SCHEDULED_EVENT_UPDATE)) {
return "";
}
str = IconUtils.getForGuild$default(Long.valueOf(this.guildId), this.guildIcon, "", false, null, 24, null);
if (str == null) {
return "";
}
return str;
case -1327124998:
if (!str2.equals(TYPE_RELATIONSHIP_ADD)) {
return "";
}
String str3 = this.applicationIcon;
return str3 != null ? IconUtils.getApplicationIcon$default(this.applicationId, str3, 0, 4, null) : "";
case -1263316859:
if (!str2.equals(TYPE_STAGE_INSTANCE_CREATE)) {
return "";
}
str = IconUtils.getForGuild$default(Long.valueOf(this.guildId), this.guildIcon, "", false, null, 24, null);
if (str == null) {
}
return str;
case -1237752112:
if (!str2.equals(TYPE_APPLICATION_LIBRARY_INSTALL_COMPLETE)) {
return "";
}
String str3 = this.applicationIcon;
if (str3 != null) {
}
break;
case 974015250:
if (!str2.equals(TYPE_ACTIVITY_START)) {
return "";
}
String str3 = this.applicationIcon;
if (str3 != null) {
}
break;
case 998188116:
if (!str2.equals(TYPE_MESSAGE_CREATE)) {
return "";
}
str = getIconUrlForChannel();
if (str == null) {
return "";
}
return str;
case 1770025841:
if (!str2.equals(TYPE_CALL_RING)) {
return "";
}
str = getIconUrlForChannel();
if (str == null) {
}
return str;
default:
return "";
}
}
public final String getIconUrlForAvatar() {
String iconUrlForGuildMember = getIconUrlForGuildMember();
return iconUrlForGuildMember != null ? iconUrlForGuildMember : getIconUrlForUser();
}
public final String getIconUrlForUser() {
return IconUtils.getForUser$default(Long.valueOf(this.userId), this.userAvatar, this.userDiscriminator, false, null, 24, null);
}
public final String getKey() {
GuildScheduledEventEntityType guildScheduledEventEntityType;
String str = this.type;
switch (str.hashCode()) {
case -1489275252:
if (!str.equals(TYPE_GUILD_SCHEDULED_EVENT_UPDATE) || (guildScheduledEventEntityType = this.guildScheduledEventEntityType) == null || guildScheduledEventEntityType.ordinal() != 1) {
return "";
}
return this.type + this.channel.h();
case -1327124998:
if (!str.equals(TYPE_RELATIONSHIP_ADD)) {
return "";
}
return this.type + this.userId;
case -1263316859:
if (!str.equals(TYPE_STAGE_INSTANCE_CREATE)) {
return "";
}
break;
case -1237752112:
if (!str.equals(TYPE_APPLICATION_LIBRARY_INSTALL_COMPLETE)) {
return "";
}
return this.type + this.applicationId;
case 974015250:
if (!str.equals(TYPE_ACTIVITY_START)) {
return "";
}
return this.type + this.activityType + this.activityName;
case 998188116:
if (!str.equals(TYPE_MESSAGE_CREATE)) {
return "";
}
break;
case 1770025841:
if (!str.equals(TYPE_CALL_RING)) {
return "";
}
break;
default:
return "";
}
return this.type + this.channel.h();
}
@RequiresApi(24)
@SuppressLint({"UnspecifiedImmutableFlag"})
public final NotificationCompat.Action getMarkAsReadAction(Context context) {
m.checkNotNullParameter(context, "ctx");
if (!m.areEqual(this.type, TYPE_MESSAGE_CREATE)) {
return null;
}
return new NotificationCompat.Action.Builder((int) R.drawable.ic_check_grey_24dp, b.h(context, R.string.mark_as_read, new Object[0], null, 4), PendingIntent.getBroadcast(context, 0, addTrackingData(NotificationActions.Companion.markAsRead(context, this.channel.h(), this.messageId)), PendingIntentExtensionsKt.immutablePendingIntentFlag$default(0, 1, null))).build();
}
public final long getMessageId() {
return this.messageId;
}
public final long getMessageIdTimestamp() {
return (this.messageId >>> 22) + SnowflakeUtils.DISCORD_EPOCH;
}
/* JADX WARNING: Removed duplicated region for block: B:16:0x0044 A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:17:0x0048 A[ORIG_RETURN, RETURN, SYNTHETIC] */
public final String getNotificationCategory() {
String str = this.type;
switch (str.hashCode()) {
case -1489275252:
return str.equals(TYPE_GUILD_SCHEDULED_EVENT_UPDATE) ? NotificationCompat.CATEGORY_SOCIAL : NotificationCompat.CATEGORY_MESSAGE;
case -1327124998:
if (str.equals(TYPE_RELATIONSHIP_ADD)) {
}
break;
case -1263316859:
if (str.equals(TYPE_STAGE_INSTANCE_CREATE)) {
}
break;
case -1237752112:
if (str.equals(TYPE_APPLICATION_LIBRARY_INSTALL_COMPLETE)) {
return "progress";
}
break;
case 974015250:
if (str.equals(TYPE_ACTIVITY_START)) {
}
break;
case 1770025841:
if (str.equals(TYPE_CALL_RING)) {
return NotificationCompat.CATEGORY_CALL;
}
break;
}
}
public final String getNotificationChannelId() {
String str = this.type;
switch (str.hashCode()) {
case -1489275252:
if (str.equals(TYPE_GUILD_SCHEDULED_EVENT_UPDATE)) {
return NotificationClient.NOTIF_GUILD_SCHEDULED_EVENT_START;
}
break;
case -1263316859:
if (str.equals(TYPE_STAGE_INSTANCE_CREATE)) {
return NotificationClient.NOTIF_CHANNEL_STAGE_START;
}
break;
case 998188116:
if (str.equals(TYPE_MESSAGE_CREATE)) {
int A = this.channel.A();
return (A == 1 || A == 3) ? NotificationClient.NOTIF_CHANNEL_MESSAGES_DIRECT : NotificationClient.NOTIF_CHANNEL_MESSAGES;
}
break;
case 1770025841:
if (str.equals(TYPE_CALL_RING)) {
return NotificationClient.NOTIF_CHANNEL_CALLS;
}
break;
}
return NotificationClient.NOTIF_CHANNEL_SOCIAL;
}
/* JADX WARNING: Removed duplicated region for block: B:12:0x003b A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:17:0x004e A[ORIG_RETURN, RETURN, SYNTHETIC] */
public final int getNotificationPriority() {
String notificationChannelId = getNotificationChannelId();
switch (notificationChannelId.hashCode()) {
case -1917463435:
return notificationChannelId.equals(NotificationClient.NOTIF_CHANNEL_MESSAGES_DIRECT) ? 1 : -1;
case -1813183603:
notificationChannelId.equals(NotificationClient.NOTIF_CHANNEL_SOCIAL);
case -1241096946:
if (notificationChannelId.equals(NotificationClient.NOTIF_CHANNEL_STAGE_START)) {
return 0;
}
break;
case -397449876:
if (notificationChannelId.equals(NotificationClient.NOTIF_CHANNEL_MESSAGES)) {
}
break;
case 64872885:
if (notificationChannelId.equals(NotificationClient.NOTIF_CHANNEL_CALLS)) {
return 2;
}
break;
case 526428889:
if (notificationChannelId.equals(NotificationClient.NOTIF_CHANNEL_MEDIA_CONNECTIONS)) {
return 2;
}
break;
case 803834207:
if (notificationChannelId.equals(NotificationClient.NOTIF_GUILD_SCHEDULED_EVENT_START)) {
}
break;
}
}
public final Uri getNotificationSound(Context context) {
m.checkNotNullParameter(context, "context");
String str = this.type;
if (str.hashCode() != 1770025841 || !str.equals(TYPE_CALL_RING)) {
return null;
}
StringBuilder L = a.L("android.resource://");
L.append(context.getPackageName() + MentionUtilsKt.SLASH_CHAR + AppSound.Companion.getSOUND_CALL_RINGING().getResId());
String sb = L.toString();
m.checkNotNullExpressionValue(sb, "StringBuilder()\n …)\n .toString()");
return Uri.parse(sb);
}
public final Person getSender(Context context) {
String replaceAfterLast$default;
MessageActivityType messageActivityType;
m.checkNotNullParameter(context, "context");
IconCompat iconCompat = null;
boolean z2 = false;
CharSequence h = (!m.areEqual(this.type, TYPE_MESSAGE_CREATE) || this.messageType == 7 || (messageActivityType = this.messageActivityType) == MessageActivityType.SPECTATE || messageActivityType == MessageActivityType.JOIN) ? b.h(context, R.string.discord, new Object[0], null, 4) : this.userUsername;
String valueOf = String.valueOf(this.userId);
String str = this.subtitle;
if (!(str == null || h == null)) {
if (this.messageType == 19 && str.length() > 11) {
String str2 = this.subtitle;
Objects.requireNonNull(str2, "null cannot be cast to non-null type java.lang.String");
String substring = str2.substring(0, 11);
m.checkNotNullExpressionValue(substring, "(this as java.lang.Strin…ing(startIndex, endIndex)");
if (m.areEqual(substring, REPLYING_TO_UNTRANSLATED)) {
StringBuilder L = a.L("<b>");
L.append(Html.escapeHtml(h));
L.append("</b> ");
String str3 = this.subtitle;
Objects.requireNonNull(str3, "null cannot be cast to non-null type java.lang.String");
String substring2 = str3.substring(0, 11);
m.checkNotNullExpressionValue(substring2, "(this as java.lang.Strin…ing(startIndex, endIndex)");
L.append(Html.escapeHtml(substring2));
L.append("<b>");
String str4 = this.subtitle;
Objects.requireNonNull(str4, "null cannot be cast to non-null type java.lang.String");
String substring3 = str4.substring(11);
m.checkNotNullExpressionValue(substring3, "(this as java.lang.String).substring(startIndex)");
L.append(Html.escapeHtml(substring3));
L.append("</b>");
h = Html.fromHtml(L.toString());
StringBuilder L2 = a.L(valueOf);
L2.append(this.subtitle);
valueOf = L2.toString();
}
}
StringBuilder L3 = a.L("<b>");
L3.append(Html.escapeHtml(h));
L3.append("</b> ");
L3.append(Html.escapeHtml(this.subtitle));
h = Html.fromHtml(L3.toString());
StringBuilder L2 = a.L(valueOf);
L2.append(this.subtitle);
valueOf = L2.toString();
}
String forUser$default = IconUtils.getForUser$default(Long.valueOf(this.userId), this.userAvatar, null, false, null, 28, null);
if (!(forUser$default == null || (replaceAfterLast$default = w.replaceAfterLast$default(forUser$default, '.', "jpg", null, 4, null)) == null)) {
iconCompat = IconCompat.createWithContentUri(replaceAfterLast$default);
}
Person.Builder icon = new Person.Builder().setName(h).setKey(valueOf).setIcon(iconCompat);
if (this.relationshipType == 1) {
z2 = true;
}
Person build = icon.setImportant(z2).build();
m.checkNotNullExpressionValue(build, "Person.Builder()\n …_FRIEND)\n .build()");
return build;
}
public final boolean getShouldGroup() {
String str = this.type;
int hashCode = str.hashCode();
return hashCode == 974015250 ? str.equals(TYPE_ACTIVITY_START) : !(hashCode != 998188116 || !str.equals(TYPE_MESSAGE_CREATE));
}
public final int getSmallIcon() {
String str = this.type;
int hashCode = str.hashCode();
if (hashCode != -1327124998) {
if (hashCode != 998188116) {
if (hashCode == 1770025841 && str.equals(TYPE_CALL_RING)) {
return R.drawable.ic_notification_call_24dp;
}
} else if (str.equals(TYPE_MESSAGE_CREATE)) {
return R.drawable.ic_notification_message_24dp;
}
} else if (str.equals(TYPE_RELATIONSHIP_ADD)) {
return R.drawable.ic_notification_friends_24dp;
}
return R.drawable.ic_notification_24dp;
}
public final Sticker getSticker() {
return this.sticker;
}
@RequiresApi(24)
@SuppressLint({"UnspecifiedImmutableFlag"})
public final NotificationCompat.Action getTimedMute(Context context, Clock clock, int i) {
m.checkNotNullParameter(context, "ctx");
m.checkNotNullParameter(clock, "clock");
if ((!m.areEqual(this.type, TYPE_MESSAGE_CREATE)) || i < 2) {
return null;
}
return new NotificationCompat.Action.Builder((int) R.drawable.ic_notifications_off_grey_24dp, b.h(context, R.string.notification_mute_1_hour, new Object[0], null, 4), PendingIntent.getBroadcast(context, 0, addTrackingData(NotificationActions.Companion.timedMute(context, this.guildId, this.channel.h(), clock.currentTimeMillis() + 3600000)), PendingIntentExtensionsKt.immutablePendingIntentFlag$default(0, 1, null))).build();
}
public final CharSequence getTitle(Context context) {
GuildScheduledEventEntityType guildScheduledEventEntityType;
m.checkNotNullParameter(context, "context");
String str = this.type;
switch (str.hashCode()) {
case -1489275252:
return (!str.equals(TYPE_GUILD_SCHEDULED_EVENT_UPDATE) || (guildScheduledEventEntityType = this.guildScheduledEventEntityType) == null || guildScheduledEventEntityType.ordinal() != 1) ? "" : b.h(context, R.string.guild_scheduled_event_stage_start_title, new Object[]{this.guildName}, null, 4);
case -1327124998:
return str.equals(TYPE_RELATIONSHIP_ADD) ? this.userUsername : "";
case -1263316859:
return str.equals(TYPE_STAGE_INSTANCE_CREATE) ? b.h(context, R.string.stage_start_push_notification_title, new Object[]{this.guildName}, null, 4) : "";
case -1237752112:
return str.equals(TYPE_APPLICATION_LIBRARY_INSTALL_COMPLETE) ? b.h(context, R.string.game_library_notification_game_installed_title, new Object[0], null, 4) : "";
case 974015250:
return (!str.equals(TYPE_ACTIVITY_START) || this.activityType != 0) ? "" : b.h(context, R.string.notification_title_start_game, new Object[0], null, 4);
case 998188116:
if (!str.equals(TYPE_MESSAGE_CREATE)) {
return "";
}
int A = this.channel.A();
if (A != 0) {
if (A == 1) {
return this.userUsername;
}
if (A == 3) {
return AnimatableValueParser.A0(this.channel, context, false, 2);
}
if (A != 5) {
switch (A) {
case 10:
case 11:
case 12:
break;
default:
return "";
}
}
}
return b.l(this.guildName + " _" + AnimatableValueParser.A0(this.channel, context, false, 2) + '_', new Object[0], null, 2);
case 1770025841:
return str.equals(TYPE_CALL_RING) ? this.channel.A() != 1 ? AnimatableValueParser.y0(this.channel) : b.h(context, R.string.incoming_call, new Object[0], null, 4) : "";
default:
return "";
}
}
public final String getType() {
return this.type;
}
public final boolean isGroupConversation() {
return this.isGroupConversation;
}
public final boolean isValid() {
String str = this.type;
switch (str.hashCode()) {
case -1489275252:
if (!str.equals(TYPE_GUILD_SCHEDULED_EVENT_UPDATE) || this.guildScheduledEventEntityType != GuildScheduledEventEntityType.STAGE_INSTANCE) {
return false;
}
break;
case -1327124998:
if (!str.equals(TYPE_RELATIONSHIP_ADD)) {
return false;
}
break;
case -1263316859:
if (!str.equals(TYPE_STAGE_INSTANCE_CREATE)) {
return false;
}
break;
case -1237752112:
if (!str.equals(TYPE_APPLICATION_LIBRARY_INSTALL_COMPLETE)) {
return false;
}
break;
case 974015250:
if (!str.equals(TYPE_ACTIVITY_START) || this.activityType == 1) {
return false;
}
break;
case 998188116:
if (!str.equals(TYPE_MESSAGE_CREATE)) {
return false;
}
break;
case 1770025841:
if (!str.equals(TYPE_CALL_RING)) {
return false;
}
break;
default:
return false;
}
return true;
}
}