2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.chat.list.adapter;
|
|
|
|
|
2022-01-14 07:57:41 +00:00
|
|
|
import android.content.Context;
|
2021-08-03 07:33:18 +00:00
|
|
|
import android.view.View;
|
|
|
|
import com.discord.api.message.MessageReference;
|
2022-01-14 07:57:41 +00:00
|
|
|
import com.discord.models.experiments.domain.Experiment;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.models.message.Message;
|
2022-01-14 07:57:41 +00:00
|
|
|
import com.discord.stores.StoreExperiments;
|
|
|
|
import com.discord.utilities.analytics.AnalyticsTracker;
|
|
|
|
import com.discord.utilities.analytics.Traits;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.utilities.channel.ChannelSelector;
|
2022-01-14 07:57:41 +00:00
|
|
|
import com.discord.utilities.view.text.LinkifiedTextView;
|
|
|
|
import com.discord.widgets.servers.guildboost.WidgetGuildBoost;
|
|
|
|
import d0.z.d.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
/* compiled from: WidgetChatListAdapterItemSystemMessage.kt */
|
|
|
|
public final class WidgetChatListAdapterItemSystemMessage$onConfigure$1 implements View.OnClickListener {
|
|
|
|
public final /* synthetic */ Message $message;
|
2022-01-14 07:57:41 +00:00
|
|
|
public final /* synthetic */ StoreExperiments $storeExperiments;
|
2021-08-03 07:33:18 +00:00
|
|
|
public final /* synthetic */ WidgetChatListAdapterItemSystemMessage this$0;
|
|
|
|
|
2022-01-14 07:57:41 +00:00
|
|
|
public WidgetChatListAdapterItemSystemMessage$onConfigure$1(WidgetChatListAdapterItemSystemMessage widgetChatListAdapterItemSystemMessage, Message message, StoreExperiments storeExperiments) {
|
2021-08-03 07:33:18 +00:00
|
|
|
this.this$0 = widgetChatListAdapterItemSystemMessage;
|
|
|
|
this.$message = message;
|
2022-01-14 07:57:41 +00:00
|
|
|
this.$storeExperiments = storeExperiments;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
|
|
public final void onClick(View view) {
|
|
|
|
Integer type = this.$message.getType();
|
2022-01-14 07:57:41 +00:00
|
|
|
if (type != null && type.intValue() == 7) {
|
|
|
|
WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getEventHandler().onMessageAuthorNameClicked(this.$message, WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getData().getGuildId());
|
|
|
|
} else if ((type != null && type.intValue() == 8) || ((type != null && type.intValue() == 9) || ((type != null && type.intValue() == 10) || (type != null && type.intValue() == 11)))) {
|
2022-02-15 08:01:19 +00:00
|
|
|
boolean z2 = true;
|
|
|
|
Experiment guildExperiment = this.$storeExperiments.getGuildExperiment("2022-01_boost_announcement_upsell", WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getData().getGuildId(), true);
|
|
|
|
if (guildExperiment == null || guildExperiment.getBucket() != 1) {
|
|
|
|
z2 = false;
|
2022-01-14 07:57:41 +00:00
|
|
|
}
|
|
|
|
if (z2) {
|
|
|
|
AnalyticsTracker.guildBoostPromotionOpened$default(AnalyticsTracker.INSTANCE, WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getData().getGuildId(), new Traits.Location(null, Traits.Location.Section.CHANNEL_TEXT_AREA, Traits.Location.Obj.BOOST_GEM_ICON, null, null, 25, null), null, 4, null);
|
|
|
|
WidgetGuildBoost.Companion companion = WidgetGuildBoost.Companion;
|
|
|
|
LinkifiedTextView linkifiedTextView = WidgetChatListAdapterItemSystemMessage.access$getBinding$p(this.this$0).d;
|
|
|
|
m.checkNotNullExpressionValue(linkifiedTextView, "binding.systemText");
|
|
|
|
Context context = linkifiedTextView.getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "binding.systemText.context");
|
|
|
|
companion.create(context, WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getData().getGuildId());
|
|
|
|
return;
|
|
|
|
}
|
2021-08-03 07:33:18 +00:00
|
|
|
WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getEventHandler().onMessageAuthorNameClicked(this.$message, WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getData().getGuildId());
|
|
|
|
} else if (type != null && type.intValue() == 12) {
|
|
|
|
WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getEventHandler().onMessageAuthorNameClicked(this.$message, WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getData().getGuildId());
|
|
|
|
} else if (type != null && type.intValue() == 6) {
|
|
|
|
WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getEventHandler().onOpenPinsClicked(this.$message);
|
|
|
|
} else if (type != null && type.intValue() == 18) {
|
|
|
|
MessageReference messageReference = this.$message.getMessageReference();
|
|
|
|
Long a = messageReference != null ? messageReference.a() : null;
|
|
|
|
if (a != null) {
|
|
|
|
ChannelSelector.selectChannel$default(ChannelSelector.Companion.getInstance(), WidgetChatListAdapterItemSystemMessage.access$getAdapter$p(this.this$0).getData().getGuildId(), a.longValue(), null, null, 12, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|